Created
May 28, 2019 17:06
-
-
Save WebDevLuke/92f306a0bded42a0fa2d8fcc25a12959 to your computer and use it in GitHub Desktop.
A few shortcuts for git in bash. Add to ~/.bash_profile
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
# Go to git directory | |
alias g='cd ~/git'; | |
# What's happening? | |
alias gs='git status'; | |
# Add all files to staging area | |
alias ga='git add -A'; | |
# Add only tracked files to staging area | |
alias gau='git add -u'; | |
# Push current branch | |
alias gp='git push origin HEAD'; | |
# Pull current branch | |
alias gpl='git pull origin HEAD'; | |
# Pass optional message to commit, like:- gc "my commit" | |
function gc() { | |
[ "$1" ] && local msg="$1" || local msg="My automated commit" | |
git add -A && git commit -m "$msg" && git push origin HEAD | |
} | |
export -f gc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment