-
Notifications
You must be signed in to change notification settings - Fork 0
/
branch-off-of-branch.txt
70 lines (59 loc) · 4.1 KB
/
branch-off-of-branch.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Here is how our branch off of a branch worked
SUMMARY:
You can branch (B) off a branch (A) off of master (M), fix some stuff in A (A`) and add stuff in B (B`). Because git works in checksums, pulling A and B into master results in the expected checksums.
For our team, this means that we can take a branch in testing (38654...) which has some things we need for a new branch (37087...). Even if we fix some things in 38654, the merge to master for both branches will work fine.
DETAIL
Start: former last commit before I started this experiment was c96dc32
1: create a branch "branch-in-testing-from-which-we-need-stuff"
2: modify master
3: We want a branch off of the first branch, so create a branch off of "branch-in-testing-from-which-we-need-stuff" called "a-new-branch-off-of-f1e2f64"
4: modify "branch-in-testing-from-which-we-need-stuff" to represent bug fixes
==============
At step 4, it looks like this
* 0406337 - (13 seconds ago) Oops, fix something in the branch Cliff Burger (HEAD, branch-in-testing-from-which-we-need
| * c3df8a6 - (5 minutes ago) Using some stuff Cliff Burger (a-new-branch-off-of-f1e2f64)
|/
* f1e2f64 - (88 minutes ago) Add a file that still needs to be tested. Cliff Burger
| * b119236 - (86 minutes ago) A change in master that is not in the branch with stuff we need. Cliff Burger (master)
|/
* 49d9086 - (2 hours ago) Start a new experiment in branching Cliff Burger
* c96dc32 - (4 weeks ago) This was merged after the foobar commits Cliff Burger (origin/merged-after-foobar, origin/mas
=========================
Step 5: Merge master into the new branch
git checkout a-new-branch-off-of-f1e2f64
git merge master
* b6648e3 - (52 seconds ago) Merge branch 'master' into a-new-branch-off-of-f1e2f64 Cliff Burger (HEAD, a-new-branch-
|\
| * d8251a2 - (76 seconds ago) Explanations through step 4, fixing a bug in the branch from which we need stuff. Cliff
| * b119236 - (2 hours ago) A change in master that is not in the branch with stuff we need. Cliff Burger
* | c3df8a6 - (12 minutes ago) Using some stuff Cliff Burger
| | * 0406337 - (8 minutes ago) Oops, fix something in the branch Cliff Burger (branch-in-testing-from-which-we-need-st
============================
Step 6: Merge "branch-in-testing-from-which-we-need-stuff" into master (pull before the dependent branch pulls)
In master: git merge branch-in-testing-from-which-we-need-stuff
* f8151e2 - (3 seconds ago) Merge branch 'branch-in-testing-from-which-we-need-stuff' Cliff Burger (HEAD, master)
|\
| * 0406337 - (14 minutes ago) Oops, fix something in the branch Cliff Burger (origin/branch-in-testing-from-which-we-n
| | * 4dc5182 - (5 minutes ago) Explain what we see after merging master to the new branch Cliff Burger (origin/a-new-b
| | * b6648e3 - (7 minutes ago) Merge branch 'master' into a-new-branch-off-of-f1e2f64 Cliff Burger
=================================
Result
* 7e30617 - (7 seconds ago) Merge a-new-branch-off-of-f1e2f64 with conflict resolution Cliff Burger (HEAD, master)
|\
| * 4dc5182 - (8 minutes ago) Explain what we see after merging master to the new branch Cliff Burger (origin/a-new-bra
| * b6648e3 - (11 minutes ago) Merge branch 'master' into a-new-branch-off-of-f1e2f64 Cliff Burger
| |\
| * | c3df8a6 - (22 minutes ago) Using some stuff Cliff Burger
* | | 2a1a8e8 - (2 minutes ago) Explain git merge branch-in-testing-from-which-we-need-stuff Cliff Burger
* | | f8151e2 - (3 minutes ago) Merge branch 'branch-in-testing-from-which-we-need-stuff' Cliff Burger
|\ \ \
| |_|/
|/| |
| * | 0406337 - (17 minutes ago) Oops, fix something in the branch Cliff Burger (origin/branch-in-testing-from-which-we
| |/
| * f1e2f64 - (2 hours ago) Add a file that still needs to be tested. Cliff Burger
* | d8251a2 - (11 minutes ago) Explanations through step 4, fixing a bug in the branch from which we need stuff. Cliff
* | b119236 - (2 hours ago) A change in master that is not in the branch with stuff we need. Cliff Burger
|/
* 49d9086 - (2 hours ago) Start a new experiment in branching Cliff Burger
* c96dc32 - (4 weeks ago) This was merged after the foobar commits Cliff Burger (origin/merged-after-foobar, merged-aft