git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
I strongly recommend both.--
[0] - https://magit.vc/
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
I strongly recommend both.--
[0] - https://magit.vc/
You can also drop `--abbrev-commit`, since `%h` abbreviates by default (use `%H` if you want the full hash).
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"lg = log --graph --date=relative --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset%n%w(0,4,4)%-b%n%n%-N'
git config --global alias.lg "log --color=auto --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'" git log --date=short --pretty=format:"%C(124)%ad %C(24)%h %C(34)%an %C(252)%s%C(178)%d" [pretty]
lg = %C(red)%h%C(reset) %C(green)%ci%C(reset) %s %C(bold blue)-- %an%C(reset)%C(yellow)%d%C(reset)
lge = %C(red)%h%C(reset) %C(green)%ci%C(reset) %s %C(bold blue)-- %an <%ae>%C(reset)%C(yellow)%d%C(reset)
reflg = %C(red)%h%C(reset) %C(green)%ci%C(reset) %s %C(bold blue)-- %an%C(reset) %C(yellow)(%gd)%C(reset)
[alias]
lg = log --pretty=lg
glg = log --graph --pretty=lg
slg = stash list --pretty=reflg
blg = branch --format '%(color:red)%(objectname:short)%(color:reset) %(color:green)%(committerdate:iso)%(color:reset) %(subject) %(color:bold blue)-- %(authorname)%(color:reset) %(color:yellow)(%(refname:short))%(color:reset)'
lg is the normal log, glg is with the graph, slg lists my stashes in the same format (i find the date really helpful), and blg does the same for branches.blg can't reuse a pretty definition because it uses a completely different formatting language. The fact that Git contains two different but largely equivalent formatting languages is kind of emblematic of its whole design, really.
Like heipei, i put the fixed-width bits on the left so that they line up. I try to use consistent and distinctive colours for everything; mostly that's obvious, but yellow draws an equivalent between branch names for the normal and branch logs, and stash refs for the stashes. Including committer name for stashes is perhaps foolish consistency, although it would be useful if you do pair programming and use something like git-duet.
tip of the iceberg.
log --no-merges --date=short --author="cyranix" --stat
This allows me to skim through my own recent changes."--no-merges" is included in just about every log invocation I run; in a continuous integration workflow, I generally don't find merge commit info to be all that informative.
As an additional tip, the "-n <count>" form of limiting the history can be shortened to "-<count>". For example, reviewing the diff of the last two commits can be achieved with "git log -p -2".
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date-order""Show no parents before all of its children are shown, but otherwise show commits in the commit timestamp order."
git status
git diff
git diff --cached
git add -A
git commit -m Hello
git push
Is instead just st
dp
di
aa
cm Hello
pu
Additionally I also have le
For git shortlog -s -e
which I don’t use very often but often enough that having an alias for it still makes senseIt still surprises me we don’t have good bash autocomplete.
Not sure how hard it is to create a shell but i’d do it in a heartbeat.
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
This is similar to others posted here.
I wonder if there's one that is as good as magit (my opinion is no, but that's why I ask)
None of them even compare with Magit. They offer a small subset of Git features - unlike Magit, which gives you almost all of them, + some higher level abstractions (like "merge into"), and you're always one ! ! press away from entering a manual command. Also, the other interfaces I've used were mostly mouse based, whereas Magit just flows. Feels order of magnitude more efficient than anything else.
Huh, I didn't know this. I'll probably live in Magit from now on.
I couldn't pay on KS so I asked him his paypal handle, but it was the KS campaign that motivated me. As you said, it's a great asset to the day of developpers (or any document maintainer under git)
My prefered tool is `tig --all` which gives me a nice view of the repo with its branches.