On Tuesday 13 December 2011 13:19:25 Curtis Olson wrote:

> I have a local project here that uses git and has a single master branch.
> 
> I had a wild and crazy idea that I wanted to explore, but knew it would
> involve a lot of code refactoring and rearchitecting -- I didn't want to
> mess up my good working tree -- especially if the idea didn't work out.  So
> I created a branch:
> 
> git checkout -b newidea
> 
> I then pushed forward with the new idea inside this branch, made several
> rounds of changes and many commits to this new branch.  Now I really like
> my new idea and I want all this work moved back into my master branch.
> 
> What's the best way do to this?

You want to merge your branch back into master. merge is the right word:
git checkout master
git merge newidea

done. If the merge creates conflicts, git will tell you so. To fix them, simply 
edit the files and add them to the index (git add fixed_file) and when you are 
done do a git commit. A merge usually creates a new commit anyway, since it's 
a new version of your source tree.
 
> Could I rename the master branch to be "pre-newidea" or whatever I want to
> call it, and then rename my "newidea" branch to "master"?  Or is that bad
> git practice?

Would be possible as well, but branching and merging are the basic tools in 
git and they are fast, simple and work quite well. And they create no 
confusion if someone else got your old master branch.

Stefan

------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and 
improve service delivery. Take 5 minutes to use this Systems Optimization 
Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to