Skip to content

Instantly share code, notes, and snippets.

@jung-kim
Last active August 30, 2016 11:48
Show Gist options
  • Save jung-kim/f6cdd6a5f255bafe6208 to your computer and use it in GitHub Desktop.
Save jung-kim/f6cdd6a5f255bafe6208 to your computer and use it in GitHub Desktop.
Ungit blog post

Ungit: The easiest way to use git.


I love Git, I think it is better than the invention of slice of bread. Git is a version control system that is elegantly distributed yet beautifully fault tolerant with powerful features. Git is a fundamental development tool that powers my company, GoGuardian, and many other companies and communities. But just like anything in our lives, it is not perfect. It has its own dark side. Git is notorious for having sharp learning curve and complex commands. If you think learning git or explaining git is easy, good for you. You are a better person than I will ever be so go cure cancer. But for most of us peons, git is a challenging beast to wrap our heads around especially for more complex operations. It may possibly be due to the fact that our minds have been abused and in the shape of CVS, SVN or, even worse, clearcase. But I'm not the only one to think this: exhibit a, b, c, d.

Even famous satirical web cartoonist XKCD did a tribute for the difficulty of Git in a humorous way.

xkcd

source xkcd.com/1597

We are aren't creatures who cultivate absolute minimum understanding required to do our work and completely reject what we don't understands. Therefor all none of us would explore beyond 8th page of Google search results on Friday night to fix the screw up we just created that is blocking an urgent bug fix. I know none of us would ever do this... EVER... We read and experiment timelessly to understand everything before we start using because are masochist software engineers.

Git developers were too focused on developing bullet proof features and user friendliness was left behind. (Although given the reputation of the author, I doubt it would have been any better even if it was in focus.) But frankly, many powerful tools often struggles with this.

Meet Ungit, an answer to Git's friendliness problems.

What is Ungit?

Ungit is an opensource node based interactive git interface with rich visualization. To dig little deeper, what Ungit does on start is to spawn a local webserver that listens to a specific port that serves web page view to display an interactive webpage for your Git repository. Ungit doesn't care what OS you are using, what IDE you are using, or what web browser you are using. If you are using Git, you can use Ungit.

Easy as that.

Using git with ungit

ungit

Feast your eyes upon prettiness of this UI.

What you see is the current representation of what Ungit's source code repository looks like according to Ungit (insert clever inception joke here).

At the top header section, we have a directory text box indicating directory path of a Git repository current view is representing along with several other operational buttons. In Body, we have each nodes representing each commits along with lines indicating each commit's git lineage along with branch information, commit message, and etc.

And did I mentioned that it is interactive?

Commit

ungit commit

There is a lot happening but what we see is that there are two modified files are unstaged in git. "testfile.txt" that was edited and newly created "do_not_commit_me". You can see you can review diffs via clicking on the names to see either default linear view or side by side comparison. After review of what we changed, I was able to unselect what is not to be committed, then only the "testfile.txt" change was committed after commit message was entered and committed. And as always, our git node refresh itself to represent accurate state of current repo by inserting the new node at the top representing newest commit. (For those of you who are picky about how synchronization works, Ungit refreshes on inactivity to active state transition based on focus and mouse events with throttling.)

You don't have to constantly juggle between add, commit, push, or checkout. You can assess entire repository state and where you are at in a simple view and interact with it real time.

But what about branch operations?

Branch checkout

ungit checkout

Branch operations are easier than ever. In above you can see that I'm switching from "abc" branch to "master" to "house_lion" and back to "abc" branch in few clicks. Once each checkout operations are done, commit nodes rearrange itself to highlight git lineage of currently checked out branch and highlights the branch tag "es6" to indicate what is currently checked out. Also, not only you can checkout branches, you can push to remote, create, delete, and move, which is pretty much all you ever dreamed of doing with drag and drop and/or click.

This is all great and all, but git tools are kind of worthless without merge conflict resolution tools and we absolutely agree.

Merge/Rebase with conflicts

ungit merge conflict

Merge or rebase happens often in a healthy corroborative git repo and conflict is bound to happen. Ungit allows you to see what you are doing and help you resolve these conflicts with ease by allowing you to mark a conflicts as resolved when you are done fixing it with you favorite weapon of choice.

And more...

There are many other features that are not shown in here such as uncommit, cherrypick, remote repository management, submodule management, commit at line level and many more already existing and others that are left for us to develop!

Oh btw, have I mentioned that we do support image diff for designers and front end people? :D

ungit view commit diff

Epilogue

We are in 21st century. We no longer type any more. We see, we click, we tab, and we touch. Our daily lives are visualized in front of us becoming interactive and intuitive. Our users are doing it, and I honestly do believe we developers should start doing it to think like our users so we can develop more user friendly products. Now, there are time and places for everything. I do love my command line tools and often I find myself surrounded by multiple ssh terminal windows flashing texts 30 mph as I have been working with distributed computations. We as developers needs to evolve and re-shape how we think and how we develop just as we have done so from SVN to Git or C++ to Java or SQL to NoSQL or any other numerous revolutions we have gone through. If there is a tool that help you understand and better use a powerful tool such as Git interactively, just like our users would have, isn't it a great place for us developers to start interacting instead of typing just like our users would have?

Ungit is not perfect, just like everything in our live, and just like Git. It obviously cannot do everything Git can do. Although I believe Ungit can and have satisfied large majority of use cases, Ungit does not expose all of Git's potential, which is bloody large. And some UI is not ideal and left something to be desired such as how we patch line by line commit. Ungit without a doubt has more room to grow.

But there is a hope.

Ungit is a community driven opensource project with MIT licence that welcomes any and all contributions. The best part is that you don't have to be an expert in Javascript or Git to start contributing. In fact, when I started contributing to Ungit I didn't know anything about Git nor Javascript. I just wanted to learn both technologies.

Hopefully you can help us "Git" to a better world... :D

Follow us on @ungitui!

P.S. Special shoutouts to @FredrikNoren who started all this. :cheers:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment