On 12/03/14 14:32, Christoph Mitasch wrote:
we are running Mediawiki with some small modifications
(e.g. the Vector.php skin).
My plan was to checkout a specific branch (e.g. 1.21.1).
Then I committed some local modifications to the code. The local repo is now ahead of
e.g. 1 commit of origin.
Minor version upgrades (1.21.2) can be merged without any trouble.
My question is now, how an major upgrade (1.21 to 1.22) preserving my local commits can
be accomplished using GIT.
The only way I found so far was using cherry-pick to transfer the local commits to the
new branch.
Hello
What's wrong with cherry-pick ?
otherwise it seems rebase can do this as well, but I never tested
(see
https://stackoverflow.com/questions/2474353/how-to-copy-commits-from-one-br…
for examples)
considering your example:
$ git checkout -t remotes/origin/REL1_20
$ echo test >> README
$ git commit -a
[REL1_20 2f1da84] testing
1 file changed, 1 insertion(+)
$ git checkout -t remotes/origin/REL1_21
$ git cherry-pick 2f1da84
(of course, depending on your modifications, there might be conflict, in which case you
solve them and add/commit the fixes)
Alexis