Hacker News new | ask | show | jobs
by Bootwizard 2521 days ago
Basically, in GUIs the most common commands are represented in UI, and some combined into a single action. Also, visually viewing the entire tree (not sure the name for the entire branching structure) can be helpful to debugging and fixing issues caused by merging, accidental overwrites, etc.

The disadvantages are:

- cherry picking commits is not easy

- lacks advanced (read uncommon) commands

- sometimes git errors are encountered that can only be solved with command line anyways

It's also way easier to onboard junior engineers who haven't used version control before.

2 comments

”cherry picking commits is not easy”

That always baffles me in git UIs. You have your list of branches on the left, list of commits in the current branch on the right (haven’t checked this client, but it likely has that), so why can’t I drag one of those commits on top of a branch to cherry-pick it?

Similarly, changing git commits shouldn’t need a separate dialog, and reordering commits could be done in-place by drag and drop (probably with a warning if done on commits that have been pushed). Yes, that’s less efficient and may occasionally lead to more or harder merge conflicts than doing complex rebase’s in one go, but it’s the GUI way.

> visually viewing the entire tree [branching structure]

You can do that with git CLI no problem, it's one of my most used aliases (so I can't recall exactly the underlying command) - just flags to log. --pretty=oneline --all --decorate is the key bit iirc.

While I'm at it, my hands down most used alias is 'fixup', which takes a ref, commits with message 'fixup! <ref>' and rebases with whatever flag makes it turn that into 'fixup' instead of 'pick' automatically. i.e. it's commit --amend for older commits.

Recently I added fzsha and fzfile too, which use fzf to fuzzy find a SHA/file, and call the git command given as $1 with it and any other supplied args. So git fzfile add stages whatever I choose in fzf, and likewise git fzsha fixup amends a fuzzy-found commit.

These GUIs look pretty, but I've no desire to learn one when it inevitably misses some things I use frequently, and adds new features I don't have, sure, but no (quick, maybe it's open source and .. sure) way of adding my own.

The mnemonic is to do it like "a dog" [1], though I think some of these flags are now default.

The one option I really like is --first-parent. If you did merge commits for every new feature, and gave sensible names to those commits (instead of "Merge A into master", use "Merge awesome feature"), it really simplifies the git history and makes it easy to grasp the dev history.

Now, on command-line vs GUI, I think the contrary is actually true: once you know your way around some piece of software, small operations are easier using CLI. However, I really appreciate GUIs to set-up the most complex ones, or the fairly complex, but rarely used ones. And of course, GUIs tend to help you discover stuff while you're still learning the software, though git CLI does that pretty well too.

[1]: https://stackoverflow.com/questions/1057564/pretty-git-branc...