Last active
June 27, 2018 08:17
-
-
Save alancoleman/87ed807c116d7934878d227d9033bf13 to your computer and use it in GitHub Desktop.
Git commands
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
# Compare branches | |
# Show name of files only | |
git diff [branch1] [branch2] --name-only | |
# Merge branches | |
# Merge with no auto commit | |
git merge [branch] --no-commit --no-ff | |
# Log | |
# One line log | |
git log --pretty=oneline -10 | |
# Graph log | |
git log --all --decorate --oneline --graph | |
# Display status of two branches as a graph, 25 commits | |
git log -25 --graph --oneline [branch] [other_branch] | |
# Commit | |
# Amend to last commit | |
$ git commit --amend --no-edit | |
# Delete local branch followed by remote | |
$ git branch -d <branch_name> | |
git push origin :<branch_name> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment