Benron Git Flashcards
See how your develop branch has diverged from your feature/my-feature branch, i.e. what’s in it that’s not reachable by your feature branch
git log feature/my-feature..develop
See what you’re about to push to remote
git log origin/master..HEAD
you can leave off head, too. it’ll be assumed
See what is in your feature/my-feature branch that has not yet been merged into your develop branch
git log develop..feature/my-feature
How do you stash both tracked files AND untracked files?
git stash -u
How do you perform a merge and ignore all whitespace changes?
git merge -Xignore-space-change
Show last 3 commits in a concise one line style
git log -3 –oneline
Interactive rebase the last 3 commits
git rebase -i HEAD~3
Show all global git settings
git config -l
Git status, concisely.
git status -s
Update your feature branch with remote develop branch
git co myfeature
git fetch
git rebase origin/develop
Or even easier:
git pull origin/develop –rebase
What does HEAD refer to?
The last commit of the current branch
Explain the syntax name1..name2
refers to all the commits reachable from name2 back to, but not including, name1
Explain the syntax name1…name2
refers to all the commits referenced by name1 or name2, but NOT by both.
Refer to all commits since a certain date
–since=”2 weeks ago”
Refer to all commits up to a certain date
–until=”1 week ago”