Live data from Hacker News

Git log – The good parts

zwischenzugs.com

41–50 of 86 posts

Re: Git log – The good parts

#41
post #24

Earlier quoted context omitted.

This one where you just type in 'git gui' and it pops up. https://git-scm.com/docs/git-gui

`git gui` is not a commit tree browser though. It's used for making commits.

Menu -> Repository -> Visualize

You can visualize current branch or all branches. It also has search, diffs and quite some options.

Re: Git log – The good parts

#42
post #14

Quote from article: "Remember that your version might do --all by default when output goes to the terminal instead of a file" Which version of Git does --all by default?

I think they meant to say "might do --decorate by default" (which Git does since v2.13.0).

Indeed, have updated - the all and decorate sections got jumbled up in an edit earlier.

Re: Git log – The good parts

#43
post #21
post #17

Earlier quoted context omitted.

You should probably avoid `--color`, as it turns on color unconditionally, even if output is going to a file. In older versions of Git the %C color placeholders were unconditional anyway. In modern Git, they respect the normal auto-coloring settings. You can also drop `--abbrev-commit`, since `%h` abbreviates by default (use `%H` if you want the full hash).

For the lazy: git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) %Creset'"

We must have started from the same source. I've since added displaying message bodies by default, but similar otherwise:

lg = log --graph --date=relative --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)%Creset%n%w(0,4,4)%-b%n%n%-N'

Re: Git log – The good parts

#44
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 use two-letter bash aliases for all my most commonly used git commands.

    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 sense

Re: Git log – The good parts

#49

I like Tortoisegit. No commands to memorize and the entire product can be worked via the keyboard. https://i.stack.imgur.com/Xc9vb.png

I like GitExtensions. I cringe when i see people manually entering hashes when they want to do stuff such as simple diffs. It's busy work. Hammering away on the keyboard but actually accomplishing so little.

Re: Git log – The good parts

#50
I don't see it mentioned anywhere, but

    git log -N (where N is 1, 2, 3, 4...)
will show the last N commits only. I find myself doing `git log -1` pretty often to see what was the last commit, so I imagine I'm not the only one.
Post reply on HN