Skip to content

Commit 6da14ee

Browse files
committed
Merge branch 'maint'
* maint: Change double quotes to single quotes in message Documentation: clarify .gitattributes search git-checkout.txt: clarify that <branch> applies when no path is given. git-checkout.txt: fix incorrect statement about HEAD and index Conflicts: Documentation/git-checkout.txt
2 parents 9e36d11 + 747f9d3 commit 6da14ee

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

Documentation/git-checkout.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,13 @@ the conflicted merge in the specified paths.
126126
<new_branch>::
127127
Name for the new branch.
128128

129+
<tree-ish>::
130+
Tree to checkout from (when paths are given). If not specified,
131+
the index will be used.
132+
129133
<branch>::
130-
Branch to checkout; may be any object ID that resolves to a
131-
commit. Defaults to HEAD.
134+
Branch to checkout (when no paths are given); may be any object
135+
ID that resolves to a commit. Defaults to HEAD.
132136
+
133137
When this parameter names a non-branch (but still a valid commit object),
134138
your HEAD becomes 'detached'.
@@ -191,7 +195,7 @@ $ git checkout hello.c <3>
191195
+
192196
<1> switch branch
193197
<2> take a file out of another commit
194-
<3> restore hello.c from HEAD of current branch
198+
<3> restore hello.c from the index
195199
+
196200
If you have an unfortunate branch that is named `hello.c`, this
197201
step would be confused as an instruction to switch to that branch.

Documentation/gitattributes.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ same as in `.gitignore` files; see linkgit:gitignore[5].
6060
When deciding what attributes are assigned to a path, git
6161
consults `$GIT_DIR/info/attributes` file (which has the highest
6262
precedence), `.gitattributes` file in the same directory as the
63-
path in question, and its parent directories (the further the
64-
directory that contains `.gitattributes` is from the path in
65-
question, the lower its precedence).
63+
path in question, and its parent directories up to the toplevel of the
64+
work tree (the further the directory that contains `.gitattributes`
65+
is from the path in question, the lower its precedence).
6666

6767
If you wish to affect only a single repository (i.e., to assign
6868
attributes to files that are particular to one user's workflow), then

Documentation/gitignore.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ precedence, the last matching pattern decides the outcome):
3131

3232
* Patterns read from a `.gitignore` file in the same directory
3333
as the path, or in any parent directory, with patterns in the
34-
higher level files (up to the root) being overridden by those in
35-
lower level files down to the directory containing the file.
34+
higher level files (up to the toplevel of the work tree) being overridden
35+
by those in lower level files down to the directory containing the file.
3636
These patterns match relative to the location of the
3737
`.gitignore` file. A project normally includes such
3838
`.gitignore` files in its repository, containing patterns for

builtin-checkout.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,10 @@ static void update_refs_for_switch(struct checkout_opts *opts,
495495
create_symref("HEAD", new->path, msg.buf);
496496
if (!opts->quiet) {
497497
if (old->path && !strcmp(new->path, old->path))
498-
fprintf(stderr, "Already on \"%s\"\n",
498+
fprintf(stderr, "Already on '%s'\n",
499499
new->name);
500500
else
501-
fprintf(stderr, "Switched to%s branch \"%s\"\n",
501+
fprintf(stderr, "Switched to%s branch '%s'\n",
502502
opts->new_branch ? " a new" : "",
503503
new->name);
504504
}
@@ -507,7 +507,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,
507507
REF_NODEREF, DIE_ON_ERR);
508508
if (!opts->quiet) {
509509
if (old->path)
510-
fprintf(stderr, "Note: moving to \"%s\" which isn't a local branch\nIf you want to create a new branch from this checkout, you may do so\n(now or later) by using -b with the checkout command again. Example:\n git checkout -b <new_branch_name>\n", new->name);
510+
fprintf(stderr, "Note: moving to '%s' which isn't a local branch\nIf you want to create a new branch from this checkout, you may do so\n(now or later) by using -b with the checkout command again. Example:\n git checkout -b <new_branch_name>\n", new->name);
511511
describe_detached_head("HEAD is now at", new->commit);
512512
}
513513
}

t/t7201-co.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ test_expect_success 'checkout to detach HEAD' '
171171
git checkout -f renamer && git clean -f &&
172172
git checkout renamer^ 2>messages &&
173173
(cat >messages.expect <<EOF
174-
Note: moving to "renamer^" which isn'"'"'t a local branch
174+
Note: moving to '\''renamer^'\'' which isn'\''t a local branch
175175
If you want to create a new branch from this checkout, you may do so
176176
(now or later) by using -b with the checkout command again. Example:
177177
git checkout -b <new_branch_name>

0 commit comments

Comments
 (0)