Managing branches in Git
I've just started to use Git, and so far I've found it useful. Naturally, there are a couple of things that have me stumped though:
1) Let's say we have two branches like so: Code:
A -- B -- D Code:
A -- B -- D So far, I've just been using git-diff to generate patches and apply them myself, but surely there's a way to do this properly? 2) In a similar situation, we have two branches again: Code:
A -- B -- D -- F Code:
A -- B -- D -- F -- G Any help on either of these cases is greatly appreciated. Mike. |
git-cherry-pick
You want git-cherry-pick.
Code:
A -- B -- D (work) Now, to apply the commit F onto the work branch you would: Code:
git-checkout work After these commands you end up with this graph: Code:
A -- B -- D -- F' (work) |
Thanks, that's sorted out problem number one, and problem two isn't all that common, so I can work around it.
|
All times are GMT -5. The time now is 07:30 PM. |