Git Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a branch?

A

Separate version of the main repository

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

How to create a branch?

A

git branch branchName

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

How to move to a branch?

A

git checkout branchName

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

What option, when moving to a branch, creates one if it doesn’t exist?

A

-b

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

What is the command to marge the current branch with a specified branch?

A

git merge branchName

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

How to delete a branch?

A

git branch -d branchName

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

What is the command to get the change history of a remote repository?

A

git fetch repoName

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

What is the command to show the differences between the current branch and a specified branch?

A

git diff branchName

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

git pull is a combination of?

A

fetch and merge

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

What is the difference between a branch and a tag?

A

A branch is a movable label placed on a commit, but a tag is a fixed label placed on a commit

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

Reset vs Hard reset

A

Reset unstages files from the index; Hard reset modifies the index and resets files in the working area

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

How does a detached head state occur?

A

If you check out a revision that has no branch label

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

What is cherry-picking?

A

Manually selecting diffs from one branch to be applied to another

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

What does git bisect do?

A

Uses a binary search algorithm to find which commit introduced a bug

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