Folding git commits

I think that there must be a commit per feature. However, one big feature consists of series of useful pieces. Consider refactoring. Though, others say that refactorins are side effects of adding/modifying functionality and do not deserve a separate commit, consider I do a couple of fixes in the code. They all refactor different areas of the codebase. I do not want to commit a big mess so that it is difficult untangle, which changes are related. I therefore spawn more than one refactoring commit. However, most likely, people do not want to see all those tiny details. I therefore want to hide all refactoring commits under one folder of commits. In the history viewer, like gitk, I then should be able to expand/collapse the folder when desired. Is there a solution to this issue, might be solved in some other versioning control?

  • Gitolite VREF/NAME - what not to push
  • svn2git: Cannot setup tracking information
  • Git - My branches are not showing after cloning a repo
  • Git pushes to wrong heroku app
  • SSLRead() error using Git in Mavericks OS X 10.9.2
  • Untracked files preventing branch checkout
  • My git branch is showing 'origin/master' and 'origin/HEAD' in Sourcetree and I don't know how to merge the two
  • Ignore all files with given name and extension
  • Should github repo also have nuget packages folder?
  • What is the p4 command equivalent to something like git/hg/bzr/svn status? (Hint: not `p4 status`)
  • Why do git status and git show disagree?
  • Xcode6 quits unexpectedly
  • 2 Solutions collect form web for “Folding git commits”

    Use feature branches. Merge them into the mainline with git merge --no-ff. The mainline is then just a series of merge commits that show one feature added another, but if you want to see the individual commits that went into a feature, they’re right there on the branch.

    I do not think it is possible to fold commits in gitk, maybe another viewer can do this. However, you can:

    • Use interactive rebase to squash or fixup commits in one (History will be lost)
    • View a diff for a range of commits: sha1..sha2. All changes from sha1 to sha2 will be viewed as one change.
    Git Baby is a git and github fan, let's start git clone.