Russell Bateman
March 2014
last update:
Install gitk, the Git repository browser. (The representation at the right is only a vague illustration whose details do not figure in this document.) If missing (and it probably is), you'll need to install gitk.
$ apt-get install gitk $ gitk --all &
The upper left-pane of gitk is a very busy GUI browser with lots going on that will take a little while to figure out. Note that yellow marks where you're at. Use Ctrl-F5 to refresh if changes happen outside gitk control during a gitk session.
The reason I began to use this tool grew out of a large project where many commits were happening while at the same time I was struggling to manage rather large slices of change work myself with, to boot, the need to justify this work in a change review setting with other engineers. My changes were scaled across multiple commits making the use of git diff or IntelliJ's Diff impractical as not all the changes were visible.
You can right-click on certain lines (where it makes sense) to "reset" which moves the current pointer back (down) to make everything already done appear as changes (in git status). That way, we can review changes across server commits as one. Options are:
--soft doesn't wipe out changes
--hard wipes out changes beyond that point
You can locate SHA1 hashes to use as arguments to git reset using
Here are random command lines to contemplate:
$ git remote update $ git stash $ git stash pop $ git branch review $ git commit fsbe-domain/ -m squash $ git checkout review $ git merge master $ git reset --soft 7687e205a55932aa58c2483b1ff0d3e296545740 $ git reset --soft fcd769d3cd916e603a5852a5a82e62fbbfde5c27
You can commit incrementally, then late do a soft reset to review and "really" do the commit:
Use git rebase --interactive to launch editor and let you "squash" changes into one. Without the interactive option, git will replay everything, but not squash multiple commits.
A good link on the above is: git-rebase(1) Manual Page.