anki-git Flashcards
How do I add a local branch to origin?
git push origin branch_name
How do you show the diff for each commit in git log?
git log -p
How do you show only two last entries for git log?
git log -2
Are tags automatically pushed to remotes?
No
What is the difference between lightweight tags and annotated tags?
Annotated tags are full git objects with email, name, checksum and date. Lightweight tags are basically just the checksum stored in a file.
How do you list all the tags?
git tag
What is similar to git diff –cached in versions 1.6.1 and later?
git diff –staged
What command adds staged changes to the last commit?
git commit –amend
What does HEAD point to?
The local branch you’re currently on
What is a branch really?
A file with the 40-character SHA-1 checksum of the commit it points to
How do you create a branch and check it out at the same time?
git checkout -b newbranch
What is a ‘fast forward’?
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 do you delete a branch?
git branch -d branchname
Why is merging easier in Git than SVN?
Git determines the best common ancestor for a merge, whereas SVN forces the dev to do it.
How do you mark a file as having resolved the merge conflict for it?
You stage it