Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
  • 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .