Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>> First, the simple optimization for Linux systems: double-click on the commit hash, q, git show, middle-click to paste. That's a simpler copy-paste. I do that surprisingly often, when browsing repositories.

Yes, I also double-click on the commit hash and copy it. But I wish there was an incrementing index starting from the top of git log, such that say the 15th commit down, I could just say `git show 15` and see that diff, instead of having to copy and paste the commit ID ( and use my mouse )



> I wish there was an incrementing index starting from the top of git log, such that say the 15th commit down, I could just say `git show 15` and see that diff, instead of having to copy and paste the commit ID ( and use my mouse )

The 15th commit down can be shown with

    git show HEAD~14
However, since the log itself does not show you the count this has limited utility since you’d have to either manually count or add some additional processing in order to insert counts into the output of git log.


If you want to navigate without using the mouse, I'd definitely suggest using vim-fugitive, or tig, or any number of git interfaces that let you browse with keyboard shortcuts.


Re: tig; That means I would need to use one command for viewing git logs, and the `git` command for everything else.

I guess if there was one git wrapper that I could use for everything, that would be better. But then I would be probably forget all the traditional git commands, and would be useless if I had to jump on another machine.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: