My Way to apply a "master" commit to the "5.1" branch
Note: Use this method only if you have forgotten to commit into the 5.1 first ! |
Contents
Get the repositories
1 [SHELL] mkdir ~/repositories
2 [SHELL] cd ~/repositories
3
4 # master branch
5 # =======================================================
6 [SHELL] git clone git@git.scilab.org:scilab
7 [SHELL] mv scilab master
8
9
10 # 5.1 branch
11 # =======================================================
12 [SHELL] git clone git@git.scilab.org:scilab
13 [SHELL] mv scilab 5.1
14 [SHELL] cd 5.1
15 # Create a local 5.1 branch
16 [SHELL] git branch 5.1 refs/remotes/origin/5.1
17 # CheckOut this branch
18 [SHELL] git checkout 5.1
19 # We don't need the master branch in this repository anymore :
20 [SHELL] git branch -D master
21
Apply a "master" commit to the "5.1" branch
1 [SHELL] cd ~/repositories/5.1
2
3 # Just check the branch
4 [SHELL] git branch
5
6 # Apply the commit
7 [SHELL] git cherry-pick <COMMIT NUMBER>
8
9 # Resolve conflicts if needed
10 [SHELL] nano <FILES IN CONLICT>
11 [SHELL] git add <FILES IN CONLICT>
12
13 # Commit it
14 [SHELL] git commit
15
16 # Send the commit to the server
17 [SHELL] git push
18
19 # Now merge the 5.1 branch with master branch
20 [SHELL] cd ~/repositories/master
21
22 # Update your "master" repository
23 [SHELL] git pull
24
25 # And now, The Merge
26 [SHELL] git merge refs/remotes/origin/5.1
27
28 # Check the commits
29 [SHELL] git log -n 4
30
31 # Send the commit to the server
32 [SHELL] git push
