3 ms·
My git shortcuts (in my bash_profile): alias g='git' alias pull='git pull origin master' alias push='git push origin master' alias gc='git commit -m $1' al
by granttimmerman 13y ago
My git shortcuts (in my bash_profile):
alias g='git'
alias pull='git pull origin master'
alias push='git push origin master'
alias gc='git commit -m $1'
alias ga='git add -A'
# Adds all and commits (gg 'Commit message')
function gg () {
git add -A;
git commit -m "$1";
git push origin master;
}
alias gs='git status'
alias gd='git diff --color'
alias gdc='git diff --cached'
alias gstat='git diff --stat'
- tjdetwiler 13y agoI don't like the idea of your gg function, but I add files to the index using git add -p exclusively since it gives me a chance to review my changes as I'm adding them, as well as let's me ensure I split up different logical changes into separate commits. Likewise, I think git commit -m encourages lazy git commit messages (see: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html http://tbaggery.com/2008/04/19/a-note-about-git-commit-messa...) Mostly because this helps me keep a clean history, which is something I value highly.