@@ -30,27 +30,27 @@ Git branches
30
30
31
31
.. note ::
32
32
33
- In Git < 2.23, ``git switch `` is not yet available. In this case you
34
- still need to use ``git checkout ``:
33
+ In Git < 2.23, ``git switch `` is not yet available. In this case you
34
+ still need to use ``git checkout ``:
35
35
36
- :samp: `$ git checkout [-b] [{ BRANCH_NAME } ] `
37
- changes the working directory to the specified branch.
36
+ :samp: `$ git checkout [-b] [{ BRANCH_NAME } ] `
37
+ changes the working directory to the specified branch.
38
38
39
- ``-b ``
40
- creates the specified branch if it does not already exist.
39
+ ``-b ``
40
+ creates the specified branch if it does not already exist.
41
41
42
42
:samp: `$ git merge { FROM_BRANCH_NAME } `
43
43
connects the specified branch with the branch you are currently in, for
44
44
example:
45
45
46
46
.. code-block :: console
47
47
48
- $ git checkout main
49
- $ git merge hotfix
50
- Updating f42c576..3a0874c
51
- Fast forward
52
- setup.py | 1 -
53
- 1 files changed, 0 insertions(+), 1 deletions(-)
48
+ $ git switch main
49
+ $ git merge hotfix
50
+ Updating f42c576..3a0874c
51
+ Fast forward
52
+ setup.py | 1 -
53
+ 1 files changed, 0 insertions(+), 1 deletions(-)
54
54
55
55
``Fast forward ``
56
56
means that the new commit immediately followed the original commit and
@@ -60,11 +60,11 @@ Git branches
60
60
61
61
.. code-block :: console
62
62
63
- $ git checkout main
64
- $ git merge 'my-feature'
65
- Merge made by recursive.
66
- setup.py | 1 +
67
- 1 files changed, 1 insertions(+), 0 deletions(-)
63
+ $ git switch main
64
+ $ git merge 'my-feature'
65
+ Merge made by recursive.
66
+ setup.py | 1 +
67
+ 1 files changed, 1 insertions(+), 0 deletions(-)
68
68
69
69
``recursive ``
70
70
is a merge strategy that is used when the merge is only to be done to
@@ -88,12 +88,12 @@ The history can then look like this, for example:
88
88
89
89
.. code-block :: console
90
90
91
- * 49770a2 (HEAD -> main) Fix merge conflict with my-feature
92
- |\
93
- | * 9412467 (my-feature) My feature
94
- * | 46ab1a2 Hotfix directly in main
95
- |/
96
- * 0c65f04 Initial commit
91
+ * 49770a2 (HEAD -> main) Fix merge conflict with my-feature
92
+ |\
93
+ | * 9412467 (my-feature) My feature
94
+ * | 46ab1a2 Hotfix directly in main
95
+ |/
96
+ * 0c65f04 Initial commit
97
97
98
98
.. seealso ::
99
99
@@ -203,7 +203,7 @@ you undo this merge because you realise that it was not finished:
203
203
204
204
.. code-block :: console
205
205
206
- $ git reset --keep @~
206
+ $ git reset --keep @~
207
207
208
208
Later you repeat the merging process:
209
209
@@ -251,8 +251,8 @@ Delete branches
251
251
``-D `` instead of ``-d `` forcing the deletion.
252
252
253
253
.. seealso ::
254
- * `Git Branching - Branches in a Nutshell
255
- <https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell> `_
254
+ * `Git Branching - Branches in a Nutshell
255
+ <https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell> `_
256
256
257
257
Remote branches
258
258
---------------
0 commit comments