Version Control in VSCode Flashcards

1
Q

Q: How do you open the Source Control view in VSCode?

A

A: Click the Source Control icon in the sidebar or press Cmd+Shift+G.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Q: How do you initialise a Git repository in VSCode?

A

A: Open the Source Control view and click Initialize Repository.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Q: How do you stage changes in VSCode?

A

A: Click the + icon next to the file in the Source Control view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Q: How do you unstage changes in VSCode?

A

A: Click the - icon next to the file in the Source Control view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Q: How do you view file changes in VSCode?

A

A: Click on the file in the Source Control view to open a diff view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Q: How do you commit changes in VSCode?

A

A: Enter a commit message in the text box at the top of the Source Control view and click the checkmark.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Q: How do you pull changes from a remote repository in VSCode?

A

A: Open the Command Palette (Cmd+Shift+P), type Git Pull, and select it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Q: How do you push changes to a remote repository in VSCode?

A

A: Click the Sync Changes button in the status bar or use the Command Palette to run Git Push.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Q: How do you create a new branch in VSCode?

A

A: Open the Command Palette, type Git: Create Branch, and follow the prompts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Q: How do you switch branches in VSCode?

A

A: Click the branch name in the status bar and select a branch from the dropdown.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Q: How do you merge branches in VSCode?

A

A: Open the Command Palette, type Git: Merge Branch, and select the branch to merge into the current branch.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Q: How do you view the commit history in VSCode?

A

A: Open the Source Control view and click the … menu, then select View Commit History (requires GitLens or similar extensions).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Q: How do you revert changes to a file in VSCode?

A

A: Right-click the file in the Source Control view and select Discard Changes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Q: How do you resolve merge conflicts in VSCode?

A

A: Open the conflicting file, and VSCode will display conflict markers with options to accept changes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Q: How do you view Git logs in VSCode?

A

A: Install the GitLens extension and use its interface to view Git logs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Q: How do you clone a repository in VSCode?

A

A: Open the Command Palette, type Git: Clone, enter the repository URL, and choose a folder to clone into.

17
Q

Q: How do you stash changes in VSCode?

A

A: Open the Command Palette, type Git: Stash, and select Stash Changes.

18
Q

Q: How do you apply a stash in VSCode?

A

A: Open the Command Palette, type Git: Stash, and select Apply Stash.

19
Q

Q: How do you delete a stash in VSCode?

A

A: Open the Command Palette, type Git: Stash, and select Drop Stash.

20
Q

Q: How do you configure Git in VSCode?

A

A: Open the Command Palette, type Git: Configure, and adjust user settings like name and email.

21
Q

Q: How do you open the Git output panel in VSCode?

A

A: Click View > Output, then select Git from the dropdown in the Output panel.

22
Q

Q: How do you create a Git tag in VSCode?

A

A: Open the Command Palette, type Git: Create Tag, and enter the tag name.

23
Q

Q: How do you fetch changes from the remote repository in VSCode?

A

A: Open the Command Palette, type Git: Fetch, and select it.

24
Q

Q: How do you undo the last commit in VSCode?

A

A: Open the Command Palette, type Git: Undo Last Commit, and confirm.

25
Q

Q: How do you view blame annotations for a file in VSCode?

A

A: Open the file, right-click, and select Open Git Blame (requires GitLens or similar extensions).