Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a git repository on a server. I can pull or clone copies from it. In a working copy, I want to create a branch and do some work. So far so standard.

While doing that work, I may well perform several commits and even create some more temporary branches as I try out ideas. That is the git way of things as I understand it.

However, when I am happy with what I have done, I want to merge the new stuff into my master branch and push the result up to the server. What I don't want is all those temporary branches and intermediate commits in my server repository. I would like to see just one (or a small number of key) commit(s) on the server not every footling little thing I tried while doing the change.

I can't work how to do that. Is it possible?

share|improve this question

1 Answer 1

  • You can squash and reorder commits in a branch using git rebase -i master, then merge it.

    See also documentation in Git Book, GitHub, git ready.

  • Branches remain local unless you push them somewhere. If you push master, other branches won't get pushed automatically.

share|improve this answer
    
Thank you. Excellent links. –  Topknot May 31 '11 at 20:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.