Sunday 15 March 2015

Copying minor updates to another branch with git -


I have started playing with GIT locally, and have come up in a matter of use that I'm sure Not that how best to handle

I am working on a spike in a branch, but then came in a simple improvement that applies to the master too. I have found the best for this moment:

  git stash git checkout master // My Correction Manually git commit- a git checkout spike git pop  
< P> Just a little curved for a line, and it involves doing me two same improvements twice. I can not help feeling that there should be a better way of doing this. In your answer, please also consider the case where there are other changes in the same file that I do not want to take.

If the changes you want to apply to a master are a complete commitment to the spike branch, then Cherie-pick command was created for this situation.

  git stash GIT checkout master GIT cherry-pick and lt; Hash & gt; GIT checkout spike GIT step pop  

If you only want a share of the Commit, use it:

  git stash git checkout master git Cherry-pick- N & lt; Hash & gt; # Tinker with index until it changes, which you want to apply for Master GIT Commit GIT Checkout Spike GIT Step Pop  

No comments:

Post a Comment