4 ms·
I use bash aliases for the same thing: alias gs='git status' alias gc='git commit -m' alias gca='git commit -a -m' alias gd='git diff' I spend most of my t
by mcobrien 16y ago
I use bash aliases for the same thing:
alias gs='git status'
alias gc='git commit -m'
alias gca='git commit -a -m'
alias gd='git diff'
I spend most of my time with gs and gd, then usually gca my changes all at once, or add those I want and use gc.
- falcolas 16y agoI do the same. alias co='git checkout' alias gb='git branch' alias gd='git diff' alias gr='git reset --hard' alias gs='git status' alias gc='git commit' alias ga='git add' But I'm moving away from using git status as much, since adding the following to my $PS1: get_branch () { GS=$(git status 2>&1) if [ $? -eq 0 ] then STAR='*' echo $GS | grep 'nothing to commit' > /dev/null 2>&1 && STAR='' echo -ne "$(echo $GS | grep 'On branch' | cut -d' ' -f4)${STAR}" else echo -ne '_' fi } It's a bit slow some days (up to a second to pop up a prompt when the box is busy), but the constant visual reference to my branch name & uncommitted changes is nice.
- mattyb 16y agoYou may find this useful: http://git.kernel.org/?p=git/git.git;a=blob_plain;f=contrib/completion/git-completion.bash;hb=HEAD http://git.kernel.org/?p=git/git.git;a=blob_plain;f=contrib/... It can tell you if your working directory is dirty, if you've got staged changes, what branch/tag you're on, and of course does completion also.
- Peaker 16y agoInstead of "git diff" followed by "git commit -a -m", I like to do: "git add -p" followed by commit. You get to see the diff, piece by piece, and separate the independent fixes.
- deleted 16y ago[deleted]