Autogenerated HTML docs for v2.51.0-372-g821f58
diff --git a/BreakingChanges.adoc b/BreakingChanges.adoc
index 344ce50..0cba20f 100644
--- a/BreakingChanges.adoc
+++ b/BreakingChanges.adoc
@@ -165,6 +165,12 @@
"reftable" format. Most importantly, alternative implementations of Git like
JGit, libgit2 and Gitoxide need to support it.
+* In new repositories, the default branch name will be `main`. We have been
+ warning that the default name will change since 675704c74dd (init:
+ provide useful advice about init.defaultBranch, 2020-12-11). The new name
+ matches the default branch name used in new repositories by many of the
+ big Git forges.
+
=== Removals
* Support for grafting commits has long been superseded by git-replace(1).
diff --git a/BreakingChanges.html b/BreakingChanges.html
index b677f26..7162e59 100644
--- a/BreakingChanges.html
+++ b/BreakingChanges.html
@@ -687,6 +687,13 @@
</ul>
</div>
</li>
+<li>
+<p>In new repositories, the default branch name will be <code>main</code>. We have been
+warning that the default name will change since 675704c74dd (init:
+provide useful advice about init.defaultBranch, 2020-12-11). The new name
+matches the default branch name used in new repositories by many of the
+big Git forges.</p>
+</li>
</ul>
</div>
</div>
@@ -832,7 +839,7 @@
</div>
<div id="footer">
<div id="footer-text">
-Last updated 2025-09-23 13:59:22 -0700
+Last updated 2025-09-29 13:02:52 -0700
</div>
</div>
</body>
diff --git a/RelNotes/2.52.0.adoc b/RelNotes/2.52.0.adoc
index c4fc561..1e52811 100644
--- a/RelNotes/2.52.0.adoc
+++ b/RelNotes/2.52.0.adoc
@@ -35,6 +35,15 @@
allow the "partialCloneFilter" settings and the "token" value to be
communicated from the server side.
+ * Declare that "git init" that is not otherwise configured uses
+ 'main' as the initial branch, not 'master', starting Git 3.0.
+
+ * Keep giving hint about the default initial branch name for users
+ who may be surprised after Git 3.0 switch-over.
+
+ * The stash.index configuration variable can be set to make "git stash
+ pop/apply" pretend that it was invoked with "--index".
+
Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
@@ -87,6 +96,12 @@
* "git range-diff" learned a way to limit the memory consumed by
O(N*N) cost matrix.
+ * Some places in the code confused a variable that is *not* a boolean
+ to enable color but is an enum that records what the user requested
+ to do about color. A couple of bugs of this sort have been fixed,
+ while the code has been cleaned up to prevent similar bugs in the
+ future.
+
Fixes since v2.51
-----------------
@@ -217,6 +232,33 @@
* "git subtree" (in contrib/) did not work correctly when splitting
squashed subtrees, which has been improved.
+ * Import a newer version of the clar unit testing framework.
+ (merge 93dbb6b3c5 ps/clar-updates later to maint).
+
+ * "git send-email --compose --reply-to=<address>" used to add
+ duplicated Reply-To: header, which made mailservers unhappy. This
+ has been corrected.
+ (merge f448f65719 nb/send-email-no-dup-reply-to later to maint).
+
+ * "git rebase -i" failed to clean-up the commit log message when the
+ command commits the final one in a chain of "fixup" commands, which
+ has been corrected.
+ (merge 82a0a73e15 pw/rebase-i-cleanup-fix later to maint).
+
+ * There are double frees and leaks around setup_revisions() API used
+ in "git stash show", which has been fixed, and setup_revisions()
+ API gained a wrapper to make it more ergonomic when using it with
+ strvec-manged argc/argv pairs.
+ (merge a04bc71725 jk/setup-revisions-freefix later to maint).
+
+ * Deal more gracefully with directory / file conflicts when the files
+ backend is used for ref storage, by failing only the ones that are
+ involved in the conflict while allowing others.
+ (merge 948b2ab0d8 kn/refs-files-case-insensitive later to maint).
+
+ * "git last-modified" operating in non-recursive mode used to trigger
+ a BUG(), which has been corrected.
+
* Other code cleanup, docfix, build fix, etc.
(merge 823d537fa7 kh/doc-git-log-markup-fix later to maint).
(merge cf7efa4f33 rj/t6137-cygwin-fix later to maint).
diff --git a/git-checkout.adoc b/git-checkout.adoc
index ff1cb29..431185c 100644
--- a/git-checkout.adoc
+++ b/git-checkout.adoc
@@ -12,25 +12,29 @@
git checkout [-q] [-f] [-m] --detach [<branch>]
git checkout [-q] [-f] [-m] [--detach] <commit>
git checkout [-q] [-f] [-m] [[-b|-B|--orphan] <new-branch>] [<start-point>]
-git checkout [-f] <tree-ish> [--] <pathspec>...
-git checkout [-f] <tree-ish> --pathspec-from-file=<file> [--pathspec-file-nul]
+git checkout <tree-ish> [--] <pathspec>...
+git checkout <tree-ish> --pathspec-from-file=<file> [--pathspec-file-nul]
git checkout [-f|--ours|--theirs|-m|--conflict=<style>] [--] <pathspec>...
git checkout [-f|--ours|--theirs|-m|--conflict=<style>] --pathspec-from-file=<file> [--pathspec-file-nul]
git checkout (-p|--patch) [<tree-ish>] [--] [<pathspec>...]
DESCRIPTION
-----------
-Updates files in the working tree to match the version in the index
-or the specified tree. If no pathspec was given, `git checkout` will
-also update `HEAD` to set the specified branch as the current
-branch.
+
+`git checkout` has two main modes:
+
+1. **Switch branches**, with `git checkout <branch>`
+2. **Restore a different version of a file**, for example with
+ `git checkout <commit> <filename>` or `git checkout <filename>`
+
+See ARGUMENT DISAMBIGUATION below for how Git decides which one to do.
`git checkout [<branch>]`::
- To prepare for working on _<branch>_, switch to it by updating
- the index and the files in the working tree, and by pointing
- `HEAD` at the branch. Local modifications to the files in the
- working tree are kept, so that they can be committed to the
- _<branch>_.
+ Switch to _<branch>_. This sets the current branch to _<branch>_ and
+ updates the files in your working directory. The checkout will fail
+ if there are uncommitted changes to any files where _<branch>_ and
+ your current commit have different content. Uncommitted changes will
+ otherwise be kept.
+
If _<branch>_ is not found but there does exist a tracking branch in
exactly one remote (call it _<remote>_) with a matching name and
@@ -40,68 +44,63 @@
$ git checkout -b <branch> --track <remote>/<branch>
------------
+
-You could omit _<branch>_, in which case the command degenerates to
-"check out the current branch", which is a glorified no-op with
-rather expensive side-effects to show only the tracking information,
-if it exists, for the current branch.
+Running `git checkout` without specifying a branch has no effect except
+to print out the tracking information for the current branch.
-`git checkout (-b|-B) <new-branch> [<start-point>]`::
+`git checkout -b <new-branch> [<start-point>]`::
- Specifying `-b` causes a new branch to be created as if
- linkgit:git-branch[1] were called and then checked out. In
- this case you can use the `--track` or `--no-track` options,
- which will be passed to `git branch`. As a convenience,
- `--track` without `-b` implies branch creation; see the
- description of `--track` below.
+ Create a new branch named _<new-branch>_, start it at _<start-point>_
+ (defaults to the current commit), and check out the new branch.
+ You can use the `--track` or `--no-track` options to set the branch's
+ upstream tracking information.
+
-If `-B` is given, _<new-branch>_ is created if it doesn't exist; otherwise, it
-is reset. This is the transactional equivalent of
-+
-------------
-$ git branch -f <branch> [<start-point>]
-$ git checkout <branch>
-------------
-+
-that is to say, the branch is not reset/created unless "git checkout" is
-successful (e.g., when the branch is in use in another worktree, not
-just the current branch stays the same, but the branch is not reset to
-the start-point, either).
+This will fail if there's an error checking out _<new-branch>_, for
+example if checking out the `<start-point>` commit would overwrite your
+uncommitted changes.
+
+`git checkout -B <branch> [<start-point>]`::
+
+ The same as `-b`, except that if the branch already exists it
+ resets `_<branch>_` to the start point instead of failing.
`git checkout --detach [<branch>]`::
`git checkout [--detach] <commit>`::
- Prepare to work on top of _<commit>_, by detaching `HEAD` at it
- (see "DETACHED HEAD" section), and updating the index and the
- files in the working tree. Local modifications to the files
- in the working tree are kept, so that the resulting working
- tree will be the state recorded in the commit plus the local
- modifications.
-+
-When the _<commit>_ argument is a branch name, the `--detach` option can
-be used to detach `HEAD` at the tip of the branch (`git checkout
-<branch>` would check out that branch without detaching `HEAD`).
+ The same as `git checkout <branch>`, except that instead of pointing
+ `HEAD` at the branch, it points `HEAD` at the commit ID.
+ See the "DETACHED HEAD" section below for more.
+
Omitting _<branch>_ detaches `HEAD` at the tip of the current branch.
-`git checkout [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <pathspec>...`::
-`git checkout [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] --pathspec-from-file=<file> [--pathspec-file-nul]`::
+`git checkout <tree-ish> [--] <pathspec>...`::
+`git checkout <tree-ish> --pathspec-from-file=<file> [--pathspec-file-nul]`::
- Overwrite the contents of the files that match the pathspec.
- When the _<tree-ish>_ (most often a commit) is not given,
- overwrite working tree with the contents in the index.
- When the _<tree-ish>_ is given, overwrite both the index and
- the working tree with the contents at the _<tree-ish>_.
+ Replace the specified files and/or directories with the version from
+ the given commit or tree and add them to the index
+ (also known as "staging area").
+
-The index may contain unmerged entries because of a previous failed merge.
-By default, if you try to check out such an entry from the index, the
-checkout operation will fail and nothing will be checked out.
-Using `-f` will ignore these unmerged entries. The contents from a
-specific side of the merge can be checked out of the index by
-using `--ours` or `--theirs`. With `-m`, changes made to the working tree
-file can be discarded to re-create the original conflicted merge result.
+For example, `git checkout main file.txt` will replace `file.txt`
+with the version from `main`.
+
+`git checkout [-f|--ours|--theirs|-m|--conflict=<style>] [--] <pathspec>...`::
+`git checkout [-f|--ours|--theirs|-m|--conflict=<style>] --pathspec-from-file=<file> [--pathspec-file-nul]`::
+
+ Replace the specified files and/or directories with the version from
+ the index.
++
+For example, if you check out a commit, edit `file.txt`, and then
+decide those changes were a mistake, `git checkout file.txt` will
+discard any unstaged changes to `file.txt`.
++
+This will fail if the file has a merge conflict and you haven't yet run
+`git add file.txt` (or something equivalent) to mark it as resolved.
+You can use `-f` to ignore the unmerged files instead of failing, use
+`--ours` or `--theirs` to replace them with the version from a specific
+side of the merge, or use `-m` to replace them with the original
+conflicted merge result.
`git checkout (-p|--patch) [<tree-ish>] [--] [<pathspec>...]`::
- This is similar to the previous mode, but lets you use the
+ This is similar to the previous two modes, but lets you use the
interactive interface to show the "diff" output and choose which
hunks to use in the result. See below for the description of
`--patch` option.
@@ -155,16 +154,14 @@
see linkgit:git-branch[1] for details.
`-B <new-branch>`::
- Creates the branch _<new-branch>_, start it at _<start-point>_;
- if it already exists, then reset it to _<start-point>_. And then
- check the resulting branch out. This is equivalent to running
- `git branch` with `-f` followed by `git checkout` of that branch;
- see linkgit:git-branch[1] for details.
+ The same as `-b`, except that if the branch already exists it
+ resets `_<branch>_` to the start point instead of failing.
`-t`::
`--track[=(direct|inherit)]`::
When creating a new branch, set up "upstream" configuration. See
- `--track` in linkgit:git-branch[1] for details.
+ `--track` in linkgit:git-branch[1] for details. As a convenience,
+ --track without -b implies branch creation.
+
If no `-b` option is given, the name of the new branch will be
derived from the remote-tracking branch, by looking at the local part of
@@ -511,14 +508,18 @@
ARGUMENT DISAMBIGUATION
-----------------------
-When there is only one argument given and it is not `--` (e.g. `git
-checkout abc`), and when the argument is both a valid _<tree-ish>_
-(e.g. a branch `abc` exists) and a valid _<pathspec>_ (e.g. a file
-or a directory whose name is "abc" exists), Git would usually ask
-you to disambiguate. Because checking out a branch is so common an
-operation, however, `git checkout abc` takes "abc" as a _<tree-ish>_
-in such a situation. Use `git checkout -- <pathspec>` if you want
-to checkout these paths out of the index.
+When you run `git checkout <something>`, Git tries to guess whether
+`<something>` is intended to be a branch, a commit, or a set of file(s),
+and then either switches to that branch or commit, or restores the
+specified files.
+
+If there's any ambiguity, Git will treat `<something>` as a branch or
+commit, but you can use the double dash `--` to force Git to treat the
+parameter as a list of files and/or directories, like this:
+
+----------
+git checkout -- file.txt
+----------
EXAMPLES
--------
diff --git a/git-checkout.html b/git-checkout.html
index d30d79f..362eb7c 100644
--- a/git-checkout.html
+++ b/git-checkout.html
@@ -456,8 +456,8 @@
<code>git</code> <code>checkout</code> [<code>-q</code>] [<code>-f</code>] [<code>-m</code>] <code>--detach</code> [<em><branch></em>]
<code>git</code> <code>checkout</code> [<code>-q</code>] [<code>-f</code>] [<code>-m</code>] [<code>--detach</code>] <em><commit></em>
<code>git</code> <code>checkout</code> [<code>-q</code>] [<code>-f</code>] [<code>-m</code>] [[<code>-b</code>|<code>-B</code>|<code>--orphan</code>] <em><new-branch></em>] [<em><start-point></em>]
-<code>git</code> <code>checkout</code> [<code>-f</code>] <em><tree-ish></em> [<code>--</code>] <em><pathspec></em>…​
-<code>git</code> <code>checkout</code> [<code>-f</code>] <em><tree-ish></em> <code>--pathspec-from-file=</code><em><file></em> [<code>--pathspec-file-nul</code>]
+<code>git</code> <code>checkout</code> <em><tree-ish></em> [<code>--</code>] <em><pathspec></em>…​
+<code>git</code> <code>checkout</code> <em><tree-ish></em> <code>--pathspec-from-file=</code><em><file></em> [<code>--pathspec-file-nul</code>]
<code>git</code> <code>checkout</code> [<code>-f</code>|<code>--ours</code>|<code>--theirs</code>|<code>-m</code>|<code>--conflict=</code><em><style></em>] [<code>--</code>] <em><pathspec></em>…​
<code>git</code> <code>checkout</code> [<code>-f</code>|<code>--ours</code>|<code>--theirs</code>|<code>-m</code>|<code>--conflict=</code><em><style></em>] <code>--pathspec-from-file=</code><em><file></em> [<code>--pathspec-file-nul</code>]
<code>git</code> <code>checkout</code> (<code>-p</code>|<code>--patch</code>) [<em><tree-ish></em>] [<code>--</code>] [<em><pathspec></em>…​]</pre>
@@ -468,20 +468,31 @@
<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
<div class="paragraph">
-<p>Updates files in the working tree to match the version in the index
-or the specified tree. If no pathspec was given, <code>git</code> <code>checkout</code> will
-also update <code>HEAD</code> to set the specified branch as the current
-branch.</p>
+<p><code>git</code> <code>checkout</code> has two main modes:</p>
+</div>
+<div class="olist arabic">
+<ol class="arabic">
+<li>
+<p><strong>Switch branches</strong>, with <code>git</code> <code>checkout</code> <em><branch></em></p>
+</li>
+<li>
+<p><strong>Restore a different version of a file</strong>, for example with
+<code>git</code> <code>checkout</code> <em><commit></em> <em><filename></em> or <code>git</code> <code>checkout</code> <em><filename></em></p>
+</li>
+</ol>
+</div>
+<div class="paragraph">
+<p>See ARGUMENT DISAMBIGUATION below for how Git decides which one to do.</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>git</code> <code>checkout</code> [<em><branch></em>]</dt>
<dd>
-<p>To prepare for working on <em><branch></em>, switch to it by updating
-the index and the files in the working tree, and by pointing
-<code>HEAD</code> at the branch. Local modifications to the files in the
-working tree are kept, so that they can be committed to the
-<em><branch></em>.</p>
+<p>Switch to <em><branch></em>. This sets the current branch to <em><branch></em> and
+updates the files in your working directory. The checkout will fail
+if there are uncommitted changes to any files where <em><branch></em> and
+your current commit have different content. Uncommitted changes will
+otherwise be kept.</p>
<div class="paragraph">
<p>If <em><branch></em> is not found but there does exist a tracking branch in
exactly one remote (call it <em><remote></em>) with a matching name and
@@ -493,76 +504,70 @@
</div>
</div>
<div class="paragraph">
-<p>You could omit <em><branch></em>, in which case the command degenerates to
-"check out the current branch", which is a glorified no-op with
-rather expensive side-effects to show only the tracking information,
-if it exists, for the current branch.</p>
+<p>Running <code>git</code> <code>checkout</code> without specifying a branch has no effect except
+to print out the tracking information for the current branch.</p>
</div>
</dd>
-<dt class="hdlist1"><code>git</code> <code>checkout</code> (<code>-b</code>|<code>-B</code>) <em><new-branch></em> [<em><start-point></em>]</dt>
+<dt class="hdlist1"><code>git</code> <code>checkout</code> <code>-b</code> <em><new-branch></em> [<em><start-point></em>]</dt>
<dd>
-<p>Specifying <code>-b</code> causes a new branch to be created as if
-<a href="git-branch.html">git-branch(1)</a> were called and then checked out. In
-this case you can use the <code>--track</code> or <code>--no-track</code> options,
-which will be passed to <code>git</code> <code>branch</code>. As a convenience,
-<code>--track</code> without <code>-b</code> implies branch creation; see the
-description of <code>--track</code> below.</p>
+<p>Create a new branch named <em><new-branch></em>, start it at <em><start-point></em>
+(defaults to the current commit), and check out the new branch.
+You can use the <code>--track</code> or <code>--no-track</code> options to set the branch’s
+upstream tracking information.</p>
<div class="paragraph">
-<p>If <code>-B</code> is given, <em><new-branch></em> is created if it doesn’t exist; otherwise, it
-is reset. This is the transactional equivalent of</p>
+<p>This will fail if there’s an error checking out <em><new-branch></em>, for
+example if checking out the <em><start-point></em> commit would overwrite your
+uncommitted changes.</p>
</div>
-<div class="listingblock">
-<div class="content">
-<pre>$ git branch -f <branch> [<start-point>]
-$ git checkout <branch></pre>
-</div>
-</div>
-<div class="paragraph">
-<p>that is to say, the branch is not reset/created unless "git checkout" is
-successful (e.g., when the branch is in use in another worktree, not
-just the current branch stays the same, but the branch is not reset to
-the start-point, either).</p>
-</div>
+</dd>
+<dt class="hdlist1"><code>git</code> <code>checkout</code> <code>-B</code> <em><branch></em> [<em><start-point></em>]</dt>
+<dd>
+<p>The same as <code>-b</code>, except that if the branch already exists it
+resets <code>_</code><em><branch></em><code>_</code> to the start point instead of failing.</p>
</dd>
<dt class="hdlist1"><code>git</code> <code>checkout</code> <code>--detach</code> [<em><branch></em>]</dt>
<dt class="hdlist1"><code>git</code> <code>checkout</code> [<code>--detach</code>] <em><commit></em></dt>
<dd>
-<p>Prepare to work on top of <em><commit></em>, by detaching <code>HEAD</code> at it
-(see "DETACHED HEAD" section), and updating the index and the
-files in the working tree. Local modifications to the files
-in the working tree are kept, so that the resulting working
-tree will be the state recorded in the commit plus the local
-modifications.</p>
-<div class="paragraph">
-<p>When the <em><commit></em> argument is a branch name, the <code>--detach</code> option can
-be used to detach <code>HEAD</code> at the tip of the branch (<code>git</code> <code>checkout</code>
-<em><branch></em> would check out that branch without detaching <code>HEAD</code>).</p>
-</div>
+<p>The same as <code>git</code> <code>checkout</code> <em><branch></em>, except that instead of pointing
+<code>HEAD</code> at the branch, it points <code>HEAD</code> at the commit ID.
+See the "DETACHED HEAD" section below for more.</p>
<div class="paragraph">
<p>Omitting <em><branch></em> detaches <code>HEAD</code> at the tip of the current branch.</p>
</div>
</dd>
-<dt class="hdlist1"><code>git</code> <code>checkout</code> [<code>-f</code>|<code>--ours</code>|<code>--theirs</code>|<code>-m</code>|<code>--conflict=</code><em><style></em>] [<em><tree-ish></em>] [<code>--</code>] <em><pathspec></em>...</dt>
-<dt class="hdlist1"><code>git</code> <code>checkout</code> [<code>-f</code>|<code>--ours</code>|<code>--theirs</code>|<code>-m</code>|<code>--conflict=</code><em><style></em>] [<em><tree-ish></em>] <code>--pathspec-from-file=</code><em><file></em> [<code>--pathspec-file-nul</code>]</dt>
+<dt class="hdlist1"><code>git</code> <code>checkout</code> <em><tree-ish></em> [<code>--</code>] <em><pathspec></em>...</dt>
+<dt class="hdlist1"><code>git</code> <code>checkout</code> <em><tree-ish></em> <code>--pathspec-from-file=</code><em><file></em> [<code>--pathspec-file-nul</code>]</dt>
<dd>
-<p>Overwrite the contents of the files that match the pathspec.
-When the <em><tree-ish></em> (most often a commit) is not given,
-overwrite working tree with the contents in the index.
-When the <em><tree-ish></em> is given, overwrite both the index and
-the working tree with the contents at the <em><tree-ish></em>.</p>
+<p>Replace the specified files and/or directories with the version from
+the given commit or tree and add them to the index
+(also known as "staging area").</p>
<div class="paragraph">
-<p>The index may contain unmerged entries because of a previous failed merge.
-By default, if you try to check out such an entry from the index, the
-checkout operation will fail and nothing will be checked out.
-Using <code>-f</code> will ignore these unmerged entries. The contents from a
-specific side of the merge can be checked out of the index by
-using <code>--ours</code> or <code>--theirs</code>. With <code>-m</code>, changes made to the working tree
-file can be discarded to re-create the original conflicted merge result.</p>
+<p>For example, <code>git</code> <code>checkout</code> <code>main</code> <code>file.txt</code> will replace <code>file.txt</code>
+with the version from <code>main</code>.</p>
+</div>
+</dd>
+<dt class="hdlist1"><code>git</code> <code>checkout</code> [<code>-f</code>|<code>--ours</code>|<code>--theirs</code>|<code>-m</code>|<code>--conflict=</code><em><style></em>] [<code>--</code>] <em><pathspec></em>...</dt>
+<dt class="hdlist1"><code>git</code> <code>checkout</code> [<code>-f</code>|<code>--ours</code>|<code>--theirs</code>|<code>-m</code>|<code>--conflict=</code><em><style></em>] <code>--pathspec-from-file=</code><em><file></em> [<code>--pathspec-file-nul</code>]</dt>
+<dd>
+<p>Replace the specified files and/or directories with the version from
+the index.</p>
+<div class="paragraph">
+<p>For example, if you check out a commit, edit <code>file.txt</code>, and then
+decide those changes were a mistake, <code>git</code> <code>checkout</code> <code>file.txt</code> will
+discard any unstaged changes to <code>file.txt</code>.</p>
+</div>
+<div class="paragraph">
+<p>This will fail if the file has a merge conflict and you haven’t yet run
+<code>git</code> <code>add</code> <code>file.txt</code> (or something equivalent) to mark it as resolved.
+You can use <code>-f</code> to ignore the unmerged files instead of failing, use
+<code>--ours</code> or <code>--theirs</code> to replace them with the version from a specific
+side of the merge, or use <code>-m</code> to replace them with the original
+conflicted merge result.</p>
</div>
</dd>
<dt class="hdlist1"><code>git</code> <code>checkout</code> (<code>-p</code>|<code>--patch</code>) [<em><tree-ish></em>] [<code>--</code>] [<em><pathspec></em>...]</dt>
<dd>
-<p>This is similar to the previous mode, but lets you use the
+<p>This is similar to the previous two modes, but lets you use the
interactive interface to show the "diff" output and choose which
hunks to use in the result. See below for the description of
<code>--patch</code> option.</p>
@@ -632,17 +637,15 @@
</dd>
<dt class="hdlist1"><code>-B</code> <em><new-branch></em></dt>
<dd>
-<p>Creates the branch <em><new-branch></em>, start it at <em><start-point></em>;
-if it already exists, then reset it to <em><start-point></em>. And then
-check the resulting branch out. This is equivalent to running
-<code>git</code> <code>branch</code> with <code>-f</code> followed by <code>git</code> <code>checkout</code> of that branch;
-see <a href="git-branch.html">git-branch(1)</a> for details.</p>
+<p>The same as <code>-b</code>, except that if the branch already exists it
+resets <code>_</code><em><branch></em><code>_</code> to the start point instead of failing.</p>
</dd>
<dt class="hdlist1"><code>-t</code></dt>
<dt class="hdlist1"><code>--track</code>[<code>=</code>(<code>direct</code>|<code>inherit</code>)]</dt>
<dd>
<p>When creating a new branch, set up "upstream" configuration. See
-<code>--track</code> in <a href="git-branch.html">git-branch(1)</a> for details.</p>
+<code>--track</code> in <a href="git-branch.html">git-branch(1)</a> for details. As a convenience,
+--track without -b implies branch creation.</p>
<div class="paragraph">
<p>If no <code>-b</code> option is given, the name of the new branch will be
derived from the remote-tracking branch, by looking at the local part of
@@ -1073,14 +1076,20 @@
<h2 id="_argument_disambiguation">ARGUMENT DISAMBIGUATION</h2>
<div class="sectionbody">
<div class="paragraph">
-<p>When there is only one argument given and it is not <code>--</code> (e.g. <code>git</code>
-<code>checkout</code> <code>abc</code>), and when the argument is both a valid <em><tree-ish></em>
-(e.g. a branch <code>abc</code> exists) and a valid <em><pathspec></em> (e.g. a file
-or a directory whose name is "abc" exists), Git would usually ask
-you to disambiguate. Because checking out a branch is so common an
-operation, however, <code>git</code> <code>checkout</code> <code>abc</code> takes "abc" as a <em><tree-ish></em>
-in such a situation. Use <code>git</code> <code>checkout</code> <code>--</code> <em><pathspec></em> if you want
-to checkout these paths out of the index.</p>
+<p>When you run <code>git</code> <code>checkout</code> <em><something></em>, Git tries to guess whether
+<em><something></em> is intended to be a branch, a commit, or a set of file(s),
+and then either switches to that branch or commit, or restores the
+specified files.</p>
+</div>
+<div class="paragraph">
+<p>If there’s any ambiguity, Git will treat <em><something></em> as a branch or
+commit, but you can use the double dash <code>--</code> to force Git to treat the
+parameter as a list of files and/or directories, like this:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>git checkout -- file.txt</pre>
+</div>
</div>
</div>
</div>
@@ -1302,7 +1311,7 @@
</div>
<div id="footer">
<div id="footer-text">
-Last updated 2025-08-25 14:46:08 -0700
+Last updated 2025-09-29 13:02:52 -0700
</div>
</div>
</body>
diff --git a/git-config.html b/git-config.html
index eced820..851f9bc 100644
--- a/git-config.html
+++ b/git-config.html
@@ -8974,6 +8974,12 @@
change as git gains new features.</p>
</div>
</dd>
+<dt class="hdlist1">stash.index</dt>
+<dd>
+<p>If this is set to true, <code>git</code> <code>stash</code> <code>apply</code> and <code>git</code> <code>stash</code> <code>pop</code> will
+behave as if <code>--index</code> was supplied. Defaults to false. See the
+descriptions in <a href="git-stash.html">git-stash(1)</a>.</p>
+</dd>
<dt class="hdlist1">stash.showIncludeUntracked</dt>
<dd>
<p>If this is set to true, the <code>git</code> <code>stash</code> <code>show</code> command will show
diff --git a/git-init.adoc b/git-init.adoc
index a0dffba..bab99b9 100644
--- a/git-init.adoc
+++ b/git-init.adoc
@@ -77,9 +77,15 @@
`-b <branch-name>`::
`--initial-branch=<branch-name>`::
Use _<branch-name>_ for the initial branch in the newly created
-repository. If not specified, fall back to the default name (currently
-`master`, but this is subject to change in the future; the name can be
-customized via the `init.defaultBranch` configuration variable).
+repository. If not specified, fall back to the default name
+ifndef::with-breaking-changes[]
+(currently `master`, but this will change to `main` when Git 3.0 is released).
+endif::with-breaking-changes[]
+ifdef::with-breaking-changes[]
+`main`.
+endif::with-breaking-changes[]
+The default name can be customized via the `init.defaultBranch` configuration
+variable.
`--shared[=(false|true|umask|group|all|world|everybody|<perm>)]`::
diff --git a/git-init.html b/git-init.html
index d68880a..cbec18f 100644
--- a/git-init.html
+++ b/git-init.html
@@ -558,9 +558,10 @@
<dt class="hdlist1"><code>--initial-branch=</code><em><branch-name></em></dt>
<dd>
<p>Use <em><branch-name></em> for the initial branch in the newly created
-repository. If not specified, fall back to the default name (currently
-<code>master</code>, but this is subject to change in the future; the name can be
-customized via the <code>init.defaultBranch</code> configuration variable).</p>
+repository. If not specified, fall back to the default name
+(currently <code>master</code>, but this will change to <code>main</code> when Git 3.0 is released).
+The default name can be customized via the <code>init.defaultBranch</code> configuration
+variable.</p>
</dd>
<dt class="hdlist1"><code>--shared</code>[<code>=</code>(<code>false</code>|<code>true</code>|<code>umask</code>|<code>group</code>|<code>all</code>|<code>world</code>|<code>everybody</code>|<em><perm></em>)]</dt>
<dd>
@@ -749,7 +750,7 @@
</div>
<div id="footer">
<div id="footer-text">
-Last updated 2025-06-20 18:10:42 -0700
+Last updated 2025-09-29 13:02:52 -0700
</div>
</div>
</body>
diff --git a/git-stash.html b/git-stash.html
index 83546fe..d06e3cc 100644
--- a/git-stash.html
+++ b/git-stash.html
@@ -958,6 +958,12 @@
</div>
<div class="dlist">
<dl>
+<dt class="hdlist1">stash.index</dt>
+<dd>
+<p>If this is set to true, <code>git</code> <code>stash</code> <code>apply</code> and <code>git</code> <code>stash</code> <code>pop</code> will
+behave as if <code>--index</code> was supplied. Defaults to false. See the
+descriptions in <a href="git-stash.html">git-stash(1)</a>.</p>
+</dd>
<dt class="hdlist1">stash.showIncludeUntracked</dt>
<dd>
<p>If this is set to true, the <code>git</code> <code>stash</code> <code>show</code> command will show