Last active
February 4, 2020 13:16
-
-
Save farskid/a7124ee7018a4a8088ac65d3474dcb1c to your computer and use it in GitHub Desktop.
Useful git tips, aliases and configs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set upstream automatically on `git push` | |
`git config --global push.default current` | |
## The reference to the last branch is saved into `-` in git. | |
# Checkout to the previous branch | |
`git checkout -` | |
# Merge into the last branch | |
`git merge -` | |
# See the diff of two branches | |
## Diff against their heads | |
`git diff branch_1..branch_2` | |
## Diff against their common ancestor | |
`git diff branch_1...branch_2` | |
# See contents of a stash without applying it | |
`git stash show -p stash@{1}` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment