Live data from Hacker News

Git log – The good parts

zwischenzugs.com

31–40 of 86 posts

Re: Git log – The good parts

#31
post #11

Earlier quoted context omitted.

Sourcetree is awful and slow. There is git gui by default, which is not perfect but IMO better that cli. I actually use Git Extensions for years now and could not find anything better.

Which Git GUI present by default do you find better than CLI? gitk? Or do you have something else in mind?

Not present by default, but I like QGit for history browsing: http://libre.tibirna.org/projects/qgit/wiki/QGit

Re: Git log – The good parts

#32
post #6

For those increasingly rare times I'm not using Magit[0], I have a "git lg" alias I found once through HN[1]: git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) %Creset' --abbrev-commit" I strongly recommend both. -- [0] - https://magit.vc/ [1] - https://coderwall.com/p/euwpig/a-better-git-log

I use a light variant from it : git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) %Creset' --abbrev-commit --date-order"

The difference is an added --date-order:

"Show no parents before all of its children are shown, but otherwise show commits in the commit timestamp order."

Re: Git log – The good parts

#33
post #6

For those increasingly rare times I'm not using Magit[0], I have a "git lg" alias I found once through HN[1]: git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) %Creset' --abbrev-commit" I strongly recommend both. -- [0] - https://magit.vc/ [1] - https://coderwall.com/p/euwpig/a-better-git-log

I couldn't bare those relative times.

My prefered tool is `tig --all` which gives me a nice view of the repo with its branches.

Re: Git log – The good parts

#34
post #22
post #6

For those increasingly rare times I'm not using Magit[0], I have a "git lg" alias I found once through HN[1]: git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) %Creset' --abbrev-commit" I strongly recommend both. -- [0] - https://magit.vc/ [1] - https://coderwall.com/p/euwpig/a-better-git-log

lol, I named my alias `git lol` because it is logs in one line.

lol, I named mine 'git l' because I type it far too often.

Re: Git log – The good parts

#35
post #22

Earlier quoted context omitted.

lol, I named my alias `git lol` because it is logs in one line.

lol, I named mine 'git l' because I type it far too often.

I named my custom logging command 'git ls', which is an idiotic name (that should list files or something), but I'm stuck with it now :)

Re: Git log – The good parts

#36
post #28
post #4

Earlier quoted context omitted.

A quick mnemonic I read on StackOverflow[1] some time ago: When using git log, do it like "a dog" git log --all --decorate --oneline --graph I must say I had forgotten about the `--all` part, but the article mentions that it should be on by default if running interactively in the terminal, at least with recent versions of git. [1]It might have been https://stackoverflow.com/questions/1057564/pretty-git-branc... but I…

I don't believe the article's claim about --all being on by default is true.

It's not, it was a typo I've corrected.

Re: Git log – The good parts

#37
post #8

Or use sourcetree

I used to love sourcetree, but after the redesign the whole thing became so slow I just went back to using CLI tools. Maybe it's for the better, as I can be way more flexible this way.

Atlassian seems to be really good at redesigns that make things slow. Jira anybody?

Re: Git log – The good parts

#38
post #4

Commands in the article: git clone https://github.com/ianmiell/cookbook-openshift3-frozen cd cookbook-openshift3-frozen git log git log --oneline git log --oneline --decorate git log --oneline --decorate --all git log --oneline --decorate --all --graph git log --oneline --decorate --all --graph --simplify-by-decoration git log --oneline --decorate --all --graph --stat git log -G 'chef-client' --graph --oneline --stat…

A quick mnemonic I read on StackOverflow[1] some time ago: When using git log, do it like "a dog" git log --all --decorate --oneline --graph I must say I had forgotten about the `--all` part, but the article mentions that it should be on by default if running interactively in the terminal, at least with recent versions of git. [1]It might have been https://stackoverflow.com/questions/1057564/pretty-git-branc... but I…

So the obvious alias would be

    git config --global alias.logadog "log --all --decorate --online --graph"

Re: Git log – The good parts

#39
An unappreciated flag of git is `--no-pager`. It allows, as said in the name, to execute a git command without using a pager.

Using this flag, my git log aliases to: `git --no-pager log --pretty=oneline -n30 --abbrev-commit`. It just shows the 30 last commits directly in my command line

Re: Git log – The good parts

#40
post #6

For those increasingly rare times I'm not using Magit[0], I have a "git lg" alias I found once through HN[1]: git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) %Creset' --abbrev-commit" I strongly recommend both. -- [0] - https://magit.vc/ [1] - https://coderwall.com/p/euwpig/a-better-git-log

I use the following since it keeps the abbreviated hash and date of the commit in their own "columns", making it easy to skim:

  git log --date=short --pretty=format:"%C(124)%ad %C(24)%h %C(34)%an %C(252)%s%C(178)%d"
Post reply on HN