mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
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
This commit is contained in:
commit
6da14ee14f
|
@ -126,9 +126,13 @@ the conflicted merge in the specified paths.
|
||||||
<new_branch>::
|
<new_branch>::
|
||||||
Name for the new branch.
|
Name for the new branch.
|
||||||
|
|
||||||
|
<tree-ish>::
|
||||||
|
Tree to checkout from (when paths are given). If not specified,
|
||||||
|
the index will be used.
|
||||||
|
|
||||||
<branch>::
|
<branch>::
|
||||||
Branch to checkout; may be any object ID that resolves to a
|
Branch to checkout (when no paths are given); may be any object
|
||||||
commit. Defaults to HEAD.
|
ID that resolves to a commit. Defaults to HEAD.
|
||||||
+
|
+
|
||||||
When this parameter names a non-branch (but still a valid commit object),
|
When this parameter names a non-branch (but still a valid commit object),
|
||||||
your HEAD becomes 'detached'.
|
your HEAD becomes 'detached'.
|
||||||
|
@ -191,7 +195,7 @@ $ git checkout hello.c <3>
|
||||||
+
|
+
|
||||||
<1> switch branch
|
<1> switch branch
|
||||||
<2> take a file out of another commit
|
<2> take a file out of another commit
|
||||||
<3> restore hello.c from HEAD of current branch
|
<3> restore hello.c from the index
|
||||||
+
|
+
|
||||||
If you have an unfortunate branch that is named `hello.c`, this
|
If you have an unfortunate branch that is named `hello.c`, this
|
||||||
step would be confused as an instruction to switch to that branch.
|
step would be confused as an instruction to switch to that branch.
|
||||||
|
|
|
@ -60,9 +60,9 @@ same as in `.gitignore` files; see linkgit:gitignore[5].
|
||||||
When deciding what attributes are assigned to a path, git
|
When deciding what attributes are assigned to a path, git
|
||||||
consults `$GIT_DIR/info/attributes` file (which has the highest
|
consults `$GIT_DIR/info/attributes` file (which has the highest
|
||||||
precedence), `.gitattributes` file in the same directory as the
|
precedence), `.gitattributes` file in the same directory as the
|
||||||
path in question, and its parent directories (the further the
|
path in question, and its parent directories up to the toplevel of the
|
||||||
directory that contains `.gitattributes` is from the path in
|
work tree (the further the directory that contains `.gitattributes`
|
||||||
question, the lower its precedence).
|
is from the path in question, the lower its precedence).
|
||||||
|
|
||||||
If you wish to affect only a single repository (i.e., to assign
|
If you wish to affect only a single repository (i.e., to assign
|
||||||
attributes to files that are particular to one user's workflow), then
|
attributes to files that are particular to one user's workflow), then
|
||||||
|
|
|
@ -31,8 +31,8 @@ precedence, the last matching pattern decides the outcome):
|
||||||
|
|
||||||
* Patterns read from a `.gitignore` file in the same directory
|
* Patterns read from a `.gitignore` file in the same directory
|
||||||
as the path, or in any parent directory, with patterns in the
|
as the path, or in any parent directory, with patterns in the
|
||||||
higher level files (up to the root) being overridden by those in
|
higher level files (up to the toplevel of the work tree) being overridden
|
||||||
lower level files down to the directory containing the file.
|
by those in lower level files down to the directory containing the file.
|
||||||
These patterns match relative to the location of the
|
These patterns match relative to the location of the
|
||||||
`.gitignore` file. A project normally includes such
|
`.gitignore` file. A project normally includes such
|
||||||
`.gitignore` files in its repository, containing patterns for
|
`.gitignore` files in its repository, containing patterns for
|
||||||
|
|
|
@ -495,10 +495,10 @@ static void update_refs_for_switch(struct checkout_opts *opts,
|
||||||
create_symref("HEAD", new->path, msg.buf);
|
create_symref("HEAD", new->path, msg.buf);
|
||||||
if (!opts->quiet) {
|
if (!opts->quiet) {
|
||||||
if (old->path && !strcmp(new->path, old->path))
|
if (old->path && !strcmp(new->path, old->path))
|
||||||
fprintf(stderr, "Already on \"%s\"\n",
|
fprintf(stderr, "Already on '%s'\n",
|
||||||
new->name);
|
new->name);
|
||||||
else
|
else
|
||||||
fprintf(stderr, "Switched to%s branch \"%s\"\n",
|
fprintf(stderr, "Switched to%s branch '%s'\n",
|
||||||
opts->new_branch ? " a new" : "",
|
opts->new_branch ? " a new" : "",
|
||||||
new->name);
|
new->name);
|
||||||
}
|
}
|
||||||
|
@ -507,7 +507,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,
|
||||||
REF_NODEREF, DIE_ON_ERR);
|
REF_NODEREF, DIE_ON_ERR);
|
||||||
if (!opts->quiet) {
|
if (!opts->quiet) {
|
||||||
if (old->path)
|
if (old->path)
|
||||||
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);
|
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);
|
||||||
describe_detached_head("HEAD is now at", new->commit);
|
describe_detached_head("HEAD is now at", new->commit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,7 +171,7 @@ test_expect_success 'checkout to detach HEAD' '
|
||||||
git checkout -f renamer && git clean -f &&
|
git checkout -f renamer && git clean -f &&
|
||||||
git checkout renamer^ 2>messages &&
|
git checkout renamer^ 2>messages &&
|
||||||
(cat >messages.expect <<EOF
|
(cat >messages.expect <<EOF
|
||||||
Note: moving to "renamer^" which isn'"'"'t a local branch
|
Note: moving to '\''renamer^'\'' which isn'\''t a local branch
|
||||||
If you want to create a new branch from this checkout, you may do so
|
If you want to create a new branch from this checkout, you may do so
|
||||||
(now or later) by using -b with the checkout command again. Example:
|
(now or later) by using -b with the checkout command again. Example:
|
||||||
git checkout -b <new_branch_name>
|
git checkout -b <new_branch_name>
|
||||||
|
|
Loading…
Reference in a new issue