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

For better or worse, I find GUI git clients to be less useful than the CLI. But like any CLI tool, it's productivity is limited by your ability to type without errors. Git has an Autocorrect[1] that will help you out.

> git config --global help.autocorrect 1

Based on bash history data, I've also added a simple alias to my bash config:

> alias gti="git"

[1]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configura...



"Based on bash history data" is an interesting point, because it highlights that you can use your history to periodically check what you do inefficiently in the terminal, and which aliases you still need to add to your config: compute some statistics on the number of 1-word and 2-word commands you use the most, and see if they are more than e.g. 4 letters.

With zsh: "history 1 | awk '{print $2}' | sort | uniq -c | sort -n"

With bash I think this should be "history" instead of "history 1".


I make one change to every new .bashrc file.

I change this:

  HISTSIZE=1000
  HISTFILESIZE=2000
to:

  HISTSIZE=1000000
  HISTFILESIZE=2000000
You would be surprised how useful this one change has been, answering historical questions easily, like how to generate that rsa key, or what packages did I install for that project last year.

You can usuall answer questions with ^r instead of the man page. Or maybe:

  "history | grep -C 10 <foo>"


While we’re on the subject of shortcuts, I have `awk1` mapped to `awk '{print $1}'` and the same up to awk9. It’s not that I can’t type it but it breaks my flow for such a simple use case.


`history 200000 | awk '{print $2" "$3}' | sort | uniq -c | sort -n`


There's a section of people that I belong to, that aren't fans of the GUI clients because it doesn't fit in their workflows but also find the CLI not productive enough. We start writing aliases and custom scripts. We integrate git with FZF.

Well for all of these people: I recently found Lazygit (https://github.com/jesseduffield/lazygit) which is a terminal UI for git and that does exactly what I've been looking for all these years, down to vim-like keybindings!


I think I've used a very similar one called LazyDocker. But after a while I found that it wasn't that useful, and I don't like seeing the "donate" button in my face all day (call me old-fashioned).

The true power of CLI apps comes from "alias" commands that you build up yourself. The following commands are great examples of this:

    alias docker-kill-all='docker kill `docker ps -aq`'
    alias docker-rm-all='docker rm `docker ps -aq`'
After a while I've learnt that a gui or cli-gui can never compose as well as the terminal can...


Lazydocker is made by the same guy yes! I don't find it as useful though.

> The true power of CLI apps comes from "alias" commands that you build up yourself

I usually agree. I spent way too many hours making aliases and I'm very proficient at it. But sometimes there's something like lazygit which does everything my aliases did, but slightly better as it gives me, for example, line-by-line staging and vim keybindings.

It is true that it does not compose, but I can still (and do) use the command line. It's just a nice increase of productivity in 90% of the cases (for me!)

Note: I'm not related to the lazygit project in any way, just very satisfied with it


Obligatory emacs magit. If you like the git cli, then magit will help you do everything with single keypress actions (l is log, c is commit) and provide autocomplete and lists where relevant (like all branches on checkout)

https://magit.vc/

Visual walk through: https://emacsair.me/2017/09/01/magit-walk-through/


Better still

> alias g="git"


or g = ./gradlew


> For better or worse, I find GUI git clients to be less useful than the CLI.

Genuinely interested, why?

I'm a huge fan of the CLI in general, but for some things it just slows me down, git usage is one of those.

Random example: reverting a commit is 2-3 clicks, or a whole lot of typing.


> Genuinely interested, why?

They usually don't support the level of granularity I have on the CLI. For example, if I want to fix a commit on a PR based on feedback I've received, I can make the fix and `git rebase -i` will let me amend any of my previous commits (via 'fixup'). None of the IDEs I've tried support it; it's possible instead of an IDE one of the dedicated git tools like Kraken support this?

It's also just mildly terrifying when the IDE gives you a button with no further explanation for what it's actually doing. I.e. what do 'refresh' and 'sync' do in VS Code? The consequences could be dire: https://github.com/microsoft/vscode/issues/32405

> reverting a commit is 2-3 clicks, or a whole lot of typing.

Git revert is a single command; finding the commit to revert is the hard part. `git bisect` makes this easy, and I haven't seen any IDEs nail that one. That said, this is a rare use case.


> Random example: reverting a commit is 2-3 clicks, or a whole lot of typing.

    git log
    git revert {hash}
I'd hardly call that a whole lot of typing. It's roughly equivalent to 2-3 clicks in a GUI app.

Where the GUI falls down for me is more complicated things, like hard resetting a branch to origin or resolving merge conflicts.

Also, most of the git guis do things that I find distressing. For example, in one git GUI I tried a while back, I accidentally dragged a commit onto a branch listed in the sidebar. Only later did I realize the gui cherry-picked the commit into the branch without asking me for confirmation. It would do similar things if I dragged one branch into another.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: