When I write the code in local, sometimes I commit the code that isn't clean yet, or, with an ugly message as temporary revision.
However, when I want my code to merge with the others, I would like the only final snapshot that the other can see, (hidden the revisions that look ugly)
Ex. I fork 0 to my local repository, I make change and test and commit with unclean code
0->1->2->3->4->5->6 (Final code)
when the others pull the code, is it possible to make other see only final state? and not see the tree from 1..5
I want users will see like
0------------------->6
One way I can think of is making a patch file, but it not good enough if there is some file have to be deleted or create.
You can use reset --soft
to squash multiple commits into a single new clean commit. With your branch at the final code with no staged changes you can do:
git reset --soft <sha1-of-0>
git commit
When git commit
prompts, give a clear commit message describing the complete changes being introduced.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With