What does HackerNews think of ungit?

The easiest way to use git. On any platform. Anywhere.

Language: JavaScript

#37 in JavaScript
#13 in Node.js
I only properly understood rebasing when I started using Ungit [1], visually seeing commits being replayed on the base branch makes it much more intuitive.

Another was treating branches as "labels", that can be advanced to a more recent linear commit timeline. Very useful for a production branch following the main dev branch (essentially electing commits as production-ready).

[1] https://github.com/FredrikNoren/ungit

My favorite Git client by far is https://github.com/FredrikNoren/ungit. Its approach of modeling the entire commit history as a digraph is the way God (or at least Linus) intended Git to be used.

Visualizing commits like that makes more interesting operations (e.g. cherry-picking, merging, rebasing, squashing) trivial to understand.

Ungit[0] shows what will happen to the tree before you execute a merge or rebase. It really helped me get a hang of Git.

[0] https://github.com/FredrikNoren/ungit

https://github.com/FredrikNoren/ungit is one of my favorite Git tools. IMHO it is the perfect compliment to the command-line interface since it provides a nice visual model of your commit graph and branches. The graph is interactive so you can use the GUI for things like merging, rebasing, cherry-picking, etc (very nice for visualizing those changes). But at the same time, the Ungit interface mostly just stays out of your way unless you need it. It does not try to force you into a certain workflow or usage pattern.
As with many things, the solution is complex because the problem is complex. Managing code history in a distributed manner, handling conflicts and allowing cooperative coding is not an easy problem to fix.

Having said this, Git doesn't make it easy by the terminology and concepts that are used. And also the inconcise UI (you use git reset for a lot of very different actions, some harmless, some very destructive) doesn't make it easy for a newcomer. Who will often resort to just remember oneliners or look them up from a manual without knowing what they actually do.

What really helped me in understanding Git was to understand the mechanics of the database on an abstract level. Commits and how branches/tags relate to them. If you understand that commits (not branches) are the tree and the branches just post-it's you put on the commits and can rearrange as you please everything becomes much more malleable. Once you discover commits are hardly ever deleted/lost, but just the post-it's are moved (which makes the commits invisible), things become easily recoverable and fixable. Also not using code, but cats[1] also seems to greatly reduced the complexity of learning Git for me. Visual tools like Ungit[2], Tig[3], or plain Git log[4] help to see the commit tree and attached branches and gives an idea of how the data is manipulated.

There is also the Gitless[0] project which tries to redefine the UI of Git, without changing the data format itself. It offers a different look at the same repository and more clear and dedicated commands/concept to perform certain tasks. And since it just uses Git itself underneath you can seamlessly switch between it and Git without issues.

[0] https://gitless.com/

[1] https://girliemac.com/blog/2017/12/26/git-purr/

[2] https://github.com/FredrikNoren/ungit

[3] https://github.com/jonas/tig

[4] git log --oneline --decorate -50 --all --graph --remotes

I only have a sample of 1 (my wife) but I've found Ungit: https://github.com/FredrikNoren/ungit unparalleled for explaining the graph model behind git — what's a merge, what it means to fetch vs pull, what's the difference between committing locally vs push etc...

The specific points that make it great for such teaching:

1. pretty graph

2. hovering over actions such as Commit / Merge / Rebase / Push shows what would happen to the graph if you do it.

3. you can manually "Move" local & remote branches anywhere you want! This is mildly risky as a habit, but much clearer to explain than fast-forward and push, especially with multiple remotes.

4. automatic fetch that works pretty well (though explicit fetch UI with multiple remotes is clunky). For people scared of merging and conflicts, it's liberating to teach "fetch is always safe" and "local commit is always safe", and that you can fast-forward or merge/rebase separate step.

Understanding that in git 'branches' are not really the branches but merely post-its that can trivially moved between the 'real' branches on the tree of commits really opened my eyes. Along with the use of visual tools like https://github.com/gitx/gitx, https://github.com/FredrikNoren/ungit, https://github.com/jonas/tig and aliases like `log --oneline --decorate -50 --all --graph --remotes`.

It really changes Git from a bunch of vague commands to a toolkit that you can use to apply the changes you desire on the database and worktree.

But even then I still get confused as the concepts of Git are not well translated into the commands, the various functions of reset and checkout. I think it is mentioned often before on HN but http://gitless.com/ is an good approach to create a new API/concepts on top of the same internals.

Some of the points mentioned are covered by the Ungit tool: https://github.com/FredrikNoren/ungit In terms of how your intended changes are visualized in the DAG model.

I stopped using this tool after getting a beter understanding of Git core and how the commands manipulate the database. But I do still think the changes suggested in the post are valuable. I'm not inline with the whole GUI idea. But I like the concept of 'everything is a commit' and reducing the 'delta algebra' to their basic forms. As my biggest struggle with Git is always to make the translation of my intended change to the database into an abstract Git command.

I'd write a GUI.

The only reason it hasn't taken over the market is that it doesn't "just work".

Ungit[0] is a project that makes good attempts at fixing the UX problems with git by making an easy-as-hell UI for it. If git came with something as fully featured as the command interface but in a good UI format then it would take over. There would be no reason to use anything else.

[0] - https://github.com/FredrikNoren/ungit

I needed something like this when I was starting out, and still occasionally do. Obviously once you've had a few dozen commits you get a hang of things, but initially, the visualisation can help a lot.

For my co-founder who's just getting started with software engineering practices like version control, I recommended she use ungit (https://github.com/FredrikNoren/ungit)

The Ungit[1] gui can also help you to visualize git operations like merging and rebasing commits. Here's the youtube demo: https://www.youtube.com/watch?v=hkBVAi3oKvo.

[1]: https://github.com/FredrikNoren/ungit