anki-git Flashcards

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

How do I add a local branch to origin?

A

git push origin branch_name

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

How do you show the diff for each commit in git log?

A

git log -p

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

How do you show only two last entries for git log?

A

git log -2

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

Are tags automatically pushed to remotes?

A

No

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

What is the difference between lightweight tags and annotated tags?

A

Annotated tags are full git objects with email, name, checksum and date. Lightweight tags are basically just the checksum stored in a file.

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

How do you list all the tags?

A

git tag

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

What is similar to git diff –cached in versions 1.6.1 and later?

A

git diff –staged

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

What command adds staged changes to the last commit?

A

git commit –amend

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

What does HEAD point to?

A

The local branch you’re currently on

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

What is a branch really?

A

A file with the 40-character SHA-1 checksum of the commit it points to

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

How do you create a branch and check it out at the same time?

A

git checkout -b newbranch

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

What is a ‘fast forward’?

A

When you try to merge one commit with a commit that can be reached by following the first commit’s history, Git simplifies things by moving the pointer forward because there is no divergent work to merge together.

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

How do you delete a branch?

A

git branch -d branchname

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

Why is merging easier in Git than SVN?

A

Git determines the best common ancestor for a merge, whereas SVN forces the dev to do it.

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

How do you mark a file as having resolved the merge conflict for it?

A

You stage it

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

How do you see the last commit on each branch?

A

git branch -v

17
Q

How do you see which branches have been merged with the current branch?

A

git branch –merged

18
Q

How do you see which branches have work that you have not merged with the current branch?

A

git branch –no-merged

19
Q

What is a tracking branch?

A

What you get when you locally check out a remote branch. They have a direct relationship with the remote and knows where to push to and pull from.

20
Q

How do you create a local branch based on a remote branch?

A

git checkout -b branchname origin/branchname

21
Q

How do you push a local branch serverfix to remote branch awesomebranch?

A

git push origin serverfix:awesomebranch

22
Q

How do you delete a remote branch?

A

git push origin :branchname