Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • that's awesome. I just played around with some "git branch foo old-merge-sha1" stuff and that's just amazing. Commented Aug 6, 2010 at 3:32
  • Is it best practice to create a branch off master for "FeatureA" then branch off "FeatureA" again for topic(s), merging them into FeatureA when they are ready, but not touching master until the entire FeatureA is ready, when you'd merge FeatureA into master? Right now (in svn) if I'm working on something that is going to take a few weeks and need a hotfix, I do what I described in my question (svn up path/to/filename) and then move on. Git branching seems to be a "merge often" recommendation, but what if I don't want the master/trunk touched until ready, so I can freely update the web site. Commented Aug 6, 2010 at 3:41
  • 2
    @Hans: You don't merge until, well, it's time to merge. Usually master is a current stable branch, so you could move a partial but stable feature if you wanted, but in general you should only merge complete things. And it's quite possible to have several stable branches of different flavors - one for a given relase (for your web site), one for current stable testing, one for unstable testing... just make sure always to merge in the right direction (topic -> feature -> master or unstable -> stable). Commented Aug 6, 2010 at 3:58
  • 2
    @Hans: You might find Junio Hamano's article on branch/merge philosophy helpful: gitster.livejournal.com/42247.html and you might also like this article about a "branching model" nvie.com/git-model Commented Aug 6, 2010 at 3:59
  • You should bold out the cherry-pick rule of thumb: don't! Commented Dec 4, 2013 at 15:07