Last active
June 19, 2019 15:08
-
-
Save dalenguyen/eab7d316cd8223096db41a4218ee24c1 to your computer and use it in GitHub Desktop.
Git shortcuts in Bash
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
# Github | |
alias gs="git status" | |
alias gd="git diff" | |
alias gp="git pull" | |
# Git finish will push to current branch | |
# Eg. gf "commit message" | |
gf() { | |
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" | |
git add . && git commit -m "$1" && git push origin "$CURRENT_BRANCH" | |
} | |
# Git merge | |
# Eg. gm branch-name | |
gm() { | |
git merge "$1" | |
} | |
# Git checkout | |
# Eg. gc branch-name | |
gc(){ | |
git checkout "$1" && gp | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment