While git guis can be nice, and there's some git alternatives coming,
the oldest trick in the book, git cli, is still the one to get things done.
If you use git cli a lot, some aliases might be in order; below I offer you my humble collection
I've even separated them, just for you, so it's easier to copy any one separately
Starting off with just the very basic, git add
alias ga="git add"
can't you see this productivity increase? that's like a 70% improvement in keystrokes!
And a nice additional alias, if you have to do some more precise commits
alias gap="git add --patch"
To know what you're going to add, it'd be nice to see your repo's status
alias gs="git status --short -b"
Quite possibly, you'll also want to know what was changes in those files
alias gd="git diff"
And to, for once in a while, see all not yet tracked files recursively, not just as folders
alias gsa="git status --short -b -u"
After you've done all this adding and diffing, you might want to commit the changes
alias gcm="git commit -m"
And push them while you're already here
alias gp="git push"
If you're coming back around to a repo you might want to pull other people's (or yours, someplace else) changes
alias gpl="git pull"
Or maybe you're opening a new repo entirely
alias gcl="git clone"
I also like a nice log once in a while
alias gl="git log --all --graph --pretty=tformat:'%C(yellow)%h %C(cyan)%an%C(auto) %C(white)%ar%C(auto) %D%n%s'"
omg, this is like 98% less keystrokes!
probably even more if you count typing "how do i print a nice git log" into your search engine of choice
One could say, this isn't an alias, but a function. I'd respond, that this is my list
With a very cryptic name, it lists all files Added, Modified or Deleted in commit $1
You can provide the usual HEAD~n shorthands
function gfc {
git diff-tree --no-commit-id --name-status -r "$1"
}
Also a very nice recent addition to my alias collection is a whoami equivalent for git,
since I often wear different hats in different folders, and it's nice to make sure
alias gme='echo $(git config user.name) $(git config user.email) $(git config user.signingkey)'
And wouldn't you know it. My benevolence knows no bounds.
I've even included a complete one, to copy if you trust me blindly
alias ga="git add"
alias gap="git add --patch"
alias gs="git status --short -b"
alias gsa="git status --short -b -u"
alias gd="git diff"
alias gcm="git commit -m"
alias gp="git push"
alias gpl="git pull"
alias gcl="git clone"
alias gl="git log --all --graph --pretty=tformat:'%C(yellow)%h %C(cyan)%an%C(auto) %C(white)%ar%C(auto) %D%n%s'"
function gfc {
git diff-tree --no-commit-id --name-status -r "$1"
}
alias gme='echo $(git config user.name) $(git config user.email) $(git config user.signingkey)'