Merge branch 'nk/ref-doc' into maint
* nk/ref-doc: glossary: clarify description of HEAD glossary: update description of head and ref glossary: update description of "tag" git.txt: de-emphasize the implementation detail of a ref check-ref-format doc: de-emphasize the implementation detail of a ref git-remote.txt: avoid sounding as if loose refs are the only ones in the world git-remote.txt: fix wrong remote refspec
This commit is contained in:
commit
3503b8d0da
@ -18,9 +18,12 @@ Checks if a given 'refname' is acceptable, and exits with a non-zero
|
|||||||
status if it is not.
|
status if it is not.
|
||||||
|
|
||||||
A reference is used in git to specify branches and tags. A
|
A reference is used in git to specify branches and tags. A
|
||||||
branch head is stored under the `$GIT_DIR/refs/heads` directory, and
|
branch head is stored in the `refs/heads` hierarchy, while
|
||||||
a tag is stored under the `$GIT_DIR/refs/tags` directory (or, if refs
|
a tag is stored in the `refs/tags` hierarchy of the ref namespace
|
||||||
are packed by `git gc`, as entries in the `$GIT_DIR/packed-refs` file).
|
(typically in `$GIT_DIR/refs/heads` and `$GIT_DIR/refs/tags`
|
||||||
|
directories or, as entries in file `$GIT_DIR/packed-refs`
|
||||||
|
if refs are packed by `git gc`).
|
||||||
|
|
||||||
git imposes the following rules on how references are named:
|
git imposes the following rules on how references are named:
|
||||||
|
|
||||||
. They can include slash `/` for hierarchical (directory)
|
. They can include slash `/` for hierarchical (directory)
|
||||||
|
@ -60,11 +60,11 @@ the remote repository.
|
|||||||
+
|
+
|
||||||
With `-t <branch>` option, instead of the default glob
|
With `-t <branch>` option, instead of the default glob
|
||||||
refspec for the remote to track all branches under
|
refspec for the remote to track all branches under
|
||||||
`$GIT_DIR/remotes/<name>/`, a refspec to track only `<branch>`
|
the `refs/remotes/<name>/` namespace, a refspec to track only `<branch>`
|
||||||
is created. You can give more than one `-t <branch>` to track
|
is created. You can give more than one `-t <branch>` to track
|
||||||
multiple branches without grabbing all branches.
|
multiple branches without grabbing all branches.
|
||||||
+
|
+
|
||||||
With `-m <master>` option, `$GIT_DIR/remotes/<name>/HEAD` is set
|
With `-m <master>` option, a symbolic-ref `refs/remotes/<name>/HEAD` is set
|
||||||
up to point at remote's `<master>` branch. See also the set-head command.
|
up to point at remote's `<master>` branch. See also the set-head command.
|
||||||
+
|
+
|
||||||
When a fetch mirror is created with `\--mirror=fetch`, the refs will not
|
When a fetch mirror is created with `\--mirror=fetch`, the refs will not
|
||||||
@ -92,24 +92,25 @@ configuration settings for the remote are removed.
|
|||||||
|
|
||||||
'set-head'::
|
'set-head'::
|
||||||
|
|
||||||
Sets or deletes the default branch (`$GIT_DIR/remotes/<name>/HEAD`) for
|
Sets or deletes the default branch (i.e. the target of the
|
||||||
|
symbolic-ref `refs/remotes/<name>/HEAD`) for
|
||||||
the named remote. Having a default branch for a remote is not required,
|
the named remote. Having a default branch for a remote is not required,
|
||||||
but allows the name of the remote to be specified in lieu of a specific
|
but allows the name of the remote to be specified in lieu of a specific
|
||||||
branch. For example, if the default branch for `origin` is set to
|
branch. For example, if the default branch for `origin` is set to
|
||||||
`master`, then `origin` may be specified wherever you would normally
|
`master`, then `origin` may be specified wherever you would normally
|
||||||
specify `origin/master`.
|
specify `origin/master`.
|
||||||
+
|
+
|
||||||
With `-d`, `$GIT_DIR/remotes/<name>/HEAD` is deleted.
|
With `-d`, the symbolic ref `refs/remotes/<name>/HEAD` is deleted.
|
||||||
+
|
+
|
||||||
With `-a`, the remote is queried to determine its `HEAD`, then
|
With `-a`, the remote is queried to determine its `HEAD`, then the
|
||||||
`$GIT_DIR/remotes/<name>/HEAD` is set to the same branch. e.g., if the remote
|
symbolic-ref `refs/remotes/<name>/HEAD` is set to the same branch. e.g., if the remote
|
||||||
`HEAD` is pointed at `next`, "`git remote set-head origin -a`" will set
|
`HEAD` is pointed at `next`, "`git remote set-head origin -a`" will set
|
||||||
`$GIT_DIR/refs/remotes/origin/HEAD` to `refs/remotes/origin/next`. This will
|
the symbolic-ref `refs/remotes/origin/HEAD` to `refs/remotes/origin/next`. This will
|
||||||
only work if `refs/remotes/origin/next` already exists; if not it must be
|
only work if `refs/remotes/origin/next` already exists; if not it must be
|
||||||
fetched first.
|
fetched first.
|
||||||
+
|
+
|
||||||
Use `<branch>` to set `$GIT_DIR/remotes/<name>/HEAD` explicitly. e.g., "git
|
Use `<branch>` to set the symbolic-ref `refs/remotes/<name>/HEAD` explicitly. e.g., "git
|
||||||
remote set-head origin master" will set `$GIT_DIR/refs/remotes/origin/HEAD` to
|
remote set-head origin master" will set the symbolic-ref `refs/remotes/origin/HEAD` to
|
||||||
`refs/remotes/origin/master`. This will only work if
|
`refs/remotes/origin/master`. This will only work if
|
||||||
`refs/remotes/origin/master` already exists; if not it must be fetched first.
|
`refs/remotes/origin/master` already exists; if not it must be fetched first.
|
||||||
+
|
+
|
||||||
|
@ -523,16 +523,15 @@ Any git command accepting any <object> can also use the following
|
|||||||
symbolic notation:
|
symbolic notation:
|
||||||
|
|
||||||
HEAD::
|
HEAD::
|
||||||
indicates the head of the current branch (i.e. the
|
indicates the head of the current branch.
|
||||||
contents of `$GIT_DIR/HEAD`).
|
|
||||||
|
|
||||||
<tag>::
|
<tag>::
|
||||||
a valid tag 'name'
|
a valid tag 'name'
|
||||||
(i.e. the contents of `$GIT_DIR/refs/tags/<tag>`).
|
(i.e. a `refs/tags/<tag>` reference).
|
||||||
|
|
||||||
<head>::
|
<head>::
|
||||||
a valid head 'name'
|
a valid head 'name'
|
||||||
(i.e. the contents of `$GIT_DIR/refs/heads/<head>`).
|
(i.e. a `refs/heads/<head>` reference).
|
||||||
|
|
||||||
For a more complete list of ways to spell object names, see
|
For a more complete list of ways to spell object names, see
|
||||||
"SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].
|
"SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].
|
||||||
|
@ -161,8 +161,8 @@ to point at the new commit.
|
|||||||
|
|
||||||
[[def_head]]head::
|
[[def_head]]head::
|
||||||
A <<def_ref,named reference>> to the <<def_commit,commit>> at the tip of a
|
A <<def_ref,named reference>> to the <<def_commit,commit>> at the tip of a
|
||||||
<<def_branch,branch>>. Heads are stored in
|
<<def_branch,branch>>. Heads are stored in a file in
|
||||||
`$GIT_DIR/refs/heads/`, except when using packed refs. (See
|
`$GIT_DIR/refs/heads/` directory, except when using packed refs. (See
|
||||||
linkgit:git-pack-refs[1].)
|
linkgit:git-pack-refs[1].)
|
||||||
|
|
||||||
[[def_HEAD]]HEAD::
|
[[def_HEAD]]HEAD::
|
||||||
@ -170,8 +170,8 @@ to point at the new commit.
|
|||||||
working tree>> is normally derived from the state of the tree
|
working tree>> is normally derived from the state of the tree
|
||||||
referred to by HEAD. HEAD is a reference to one of the
|
referred to by HEAD. HEAD is a reference to one of the
|
||||||
<<def_head,heads>> in your repository, except when using a
|
<<def_head,heads>> in your repository, except when using a
|
||||||
<<def_detached_HEAD,detached HEAD>>, in which case it may
|
<<def_detached_HEAD,detached HEAD>>, in which case it directly
|
||||||
reference an arbitrary commit.
|
references an arbitrary commit.
|
||||||
|
|
||||||
[[def_head_ref]]head ref::
|
[[def_head_ref]]head ref::
|
||||||
A synonym for <<def_head,head>>.
|
A synonym for <<def_head,head>>.
|
||||||
@ -382,8 +382,9 @@ should not be combined with other pathspec.
|
|||||||
|
|
||||||
[[def_ref]]ref::
|
[[def_ref]]ref::
|
||||||
A 40-byte hex representation of a <<def_SHA1,SHA1>> or a name that
|
A 40-byte hex representation of a <<def_SHA1,SHA1>> or a name that
|
||||||
denotes a particular <<def_object,object>>. These may be stored in
|
denotes a particular <<def_object,object>>. They may be stored in
|
||||||
`$GIT_DIR/refs/`.
|
a file under `$GIT_DIR/refs/` directory, or
|
||||||
|
in the `$GIT_DIR/packed-refs` file.
|
||||||
|
|
||||||
[[def_reflog]]reflog::
|
[[def_reflog]]reflog::
|
||||||
A reflog shows the local "history" of a ref. In other words,
|
A reflog shows the local "history" of a ref. In other words,
|
||||||
@ -459,14 +460,14 @@ should not be combined with other pathspec.
|
|||||||
command.
|
command.
|
||||||
|
|
||||||
[[def_tag]]tag::
|
[[def_tag]]tag::
|
||||||
A <<def_ref,ref>> pointing to a <<def_tag_object,tag>> or
|
A <<def_ref,ref>> under `refs/tags/` namespace that points to an
|
||||||
<<def_commit_object,commit object>>. In contrast to a <<def_head,head>>,
|
object of an arbitrary type (typically a tag points to either a
|
||||||
a tag is not changed by a <<def_commit,commit>>. Tags (not
|
<<def_tag_object,tag>> or a <<def_commit_object,commit object>>).
|
||||||
<<def_tag_object,tag objects>>) are stored in `$GIT_DIR/refs/tags/`. A
|
In contrast to a <<def_head,head>>, a tag is not updated by
|
||||||
git tag has nothing to do with a Lisp tag (which would be
|
the `commit` command. A git tag has nothing to do with a Lisp
|
||||||
called an <<def_object_type,object type>> in git's context). A
|
tag (which would be called an <<def_object_type,object type>>
|
||||||
tag is most typically used to mark a particular point in the
|
in git's context). A tag is most typically used to mark a particular
|
||||||
commit ancestry <<def_chain,chain>>.
|
point in the commit ancestry <<def_chain,chain>>.
|
||||||
|
|
||||||
[[def_tag_object]]tag object::
|
[[def_tag_object]]tag object::
|
||||||
An <<def_object,object>> containing a <<def_ref,ref>> pointing to
|
An <<def_object,object>> containing a <<def_ref,ref>> pointing to
|
||||||
|
Loading…
Reference in New Issue
Block a user