Skip to content

Commit fc22be6

Browse files
committed
📝 Adopt Git 2.56 features
* Add git add --resolved * Add git merge-base
1 parent e64b3ab commit fc22be6

2 files changed

Lines changed: 32 additions & 6 deletions

File tree

‎CHANGELOG.rst‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ emergencies when we need to start branches for older versions.
2323
Added
2424
~~~~~
2525

26+
📝 Adopt Git 2.56 features
27+
28+
* Add git add --resolved
29+
* Add git merge-base
30+
2631
* 📝 Add citation specifications for data
2732
📝 Add CSVW
2833

‎docs/productive/git/branch.rst‎

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,9 @@ Git branches
3030
``-c``
3131
creates the branch to switch to.
3232

33-
:samp:`$ git switch -`
34-
alternates between the last two branches. This makes it much easier to jump
35-
back and forth between branches.
36-
37-
.. note::
33+
.. version-added:: 2.24
3834

39-
In Git < 2.23, ``git switch`` is not yet available. In this case you
35+
Before Git 2.24, ``git switch`` is not yet available. In this case you
4036
still need to use ``git checkout``:
4137

4238
:samp:`$ git checkout [-b] [{BRANCH_NAME}]`
@@ -45,6 +41,10 @@ Git branches
4541
``-b``
4642
creates the specified branch if it does not already exist.
4743

44+
:samp:`$ git switch -`
45+
alternates between the last two branches. This makes it much easier to jump
46+
back and forth between branches.
47+
4848
:samp:`$ git merge {FROM_BRANCH_NAME}`
4949
connects the specified branch with the branch you are currently in, for
5050
example:
@@ -76,6 +76,20 @@ Git branches
7676
is a merge strategy that is used when the merge is only to be done to
7777
``HEAD``.
7878

79+
:samp:`$ git merge-base [-a|--all] {COMMIT {COMMIT}`
80+
finds the best possible common ancestors for a merge.
81+
82+
.. _git-merge-base:
83+
84+
.. version-added:: 2.56
85+
86+
From Git 2.56 onwards, the search has improved considerably, particularly
87+
for so-called criss-cross merges.
88+
89+
.. seealso::
90+
* `Stop searching history once no more merge bases can exist
91+
<https://github.blog/open-source/git/highlights-from-git-2-56/#h-stop-searching-history-once-no-more-merge-bases-can-exist>`_
92+
7993
.. _merge-conflicts:
8094

8195
Merge conflicts
@@ -101,6 +115,13 @@ The history can then look like this, for example:
101115
|/
102116
* 0c65f04 Initial commit
103117
118+
.. _git-add-resolved:
119+
120+
.. version-added:: 2.56
121+
122+
From Git 2.56 onwards, you can use ``git add --resolved`` to include only
123+
those paths that have not yet been merged into the index.
124+
104125
.. seealso::
105126

106127
* `Git Branching - Basic Branching and Merging

0 commit comments

Comments
 (0)