Git: Merge in only one commit

Posted by Ivan on Stack Overflow See other posts from Stack Overflow or by Ivan
Published on 2011-01-05T10:51:36Z Indexed on 2011/01/05 10:53 UTC
Read the original article Hit count: 228

Filed under:
|

Usually, I work with branches in Git, but I don't like to see hundreds of branches in my working tree (Git history). I'm wondering if there is a method in Git to "join" all commits in a branch in only one commit (ideally with a clear commit message).

Something like this:

git checkout -b branch
<some work>
git commit -a -m "commit 1"
<some work>
git commit -a -m "commit 2"
<some work>
git commit -a -m "commit 3"
git checkout master
git SUPER-JOIN branch -m "super commit"

After this, only "super commit" will exist in the git log.

© Stack Overflow or respective owner

Related posts about git

Related posts about branch