Trying to push only key commits to git server

3

1

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?

Topknot

Posted 2011-05-05T22:31:57.560

Reputation: 31

Answers

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.

user1686

Posted 2011-05-05T22:31:57.560

Reputation: 283 655