interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / Documentation / git-refs.adoc

153 lines · 4998 bytes Raw Blame History
1git-refs(1)
2===========
3
4NAME
5----
6git-refs - Low-level access to refs
7
8
9SYNOPSIS
10--------
11[synopsis]
12git refs migrate --ref-storage-format=<format> [--no-reflog] [--dry-run]
13git refs verify [--strict] [--verbose]
14git refs optimize [--all] [--no-prune] [--auto] [--include <pattern>] [--exclude <pattern>]
15git refs list [--count=<count>] [--shell|--perl|--python|--tcl]
16 [(--sort=<key>)...] [--format=<format>]
17 [--include-root-refs] [--points-at=<object>]
18 [--merged[=<object>]] [--no-merged[=<object>]]
19 [--contains[=<object>]] [--no-contains[=<object>]]
20 [(--exclude=<pattern>)...] [--start-after=<marker>]
21 [ --stdin | (<pattern>...)]
22git refs exists <ref>
23git refs create [--message=<reason>] [--no-deref] [--create-reflog] <ref> <new-value>
24git refs delete [--message=<reason>] [--no-deref] <ref> [<old-value>]
25git refs update [--message=<reason>] [--no-deref] [--create-reflog] <ref> <new-value> [<old-value>]
26git refs rename [--message=<reason>] <old-ref> <new-ref>
27
28DESCRIPTION
29-----------
30
31This command provides low-level access to refs.
32
33COMMANDS
34--------
35
36`migrate`::
37 Migrate ref store between different formats.
38+
39[WARNING]
40--
41The ref format migration has several known limitations in its current form:
42
43* It is not possible to migrate repositories that have worktrees.
44
45* There is no way to block concurrent writes to the repository during an
46 ongoing migration. Concurrent writes can lead to an inconsistent migrated
47 state. Users are expected to block writes on a higher level. If your
48 repository is registered for scheduled maintenance, it is recommended to
49 unregister it first with linkgit:git-maintenance[1].
50
51These limitations may eventually be lifted.
52--
53
54`verify`::
55 Verify reference database consistency.
56
57`list`::
58 List references in the repository with support for filtering,
59 formatting, and sorting. This subcommand is an alias for
60 linkgit:git-for-each-ref[1] and offers identical functionality.
61
62`exists`::
63 Check whether the given reference exists. Returns an exit code of 0 if
64 it does, 2 if it is missing, and 1 in case looking up the reference
65 failed with an error other than the reference being missing. This does
66 not verify whether the reference resolves to an actual object.
67
68`optimize`::
69 Optimizes references to improve repository performance and reduce disk
70 usage. This subcommand is an alias for linkgit:git-pack-refs[1] and
71 offers identical functionality.
72
73`create`::
74 Create the given reference, which must not already exist, pointing at
75 `<new-value>`.
76
77`delete`::
78 Delete the given reference. This subcommand mirrors `git update-ref -d`
79 (see linkgit:git-update-ref[1]). When `<old-value>` is given, the
80 reference is only deleted after verifying that it currently contains
81 `<old-value>`.
82
83`update`::
84 Update the given reference to point at `<new-value>`. If `<old-value>`
85 is given, the reference is only updated after verifying that it
86 currently contains `<old-value>`. As a special case, an all-zeroes
87 `<new-value>` deletes the branch, whereas an all-zeroes `<old-value>`
88 ensures that the branch does not yet exist.
89
90`rename`::
91 Rename the reference `<oldref>` to `<newref>`. The old reference must
92 exist and the new reference must not yet exist, and both must have a
93 well-formed name (see linkgit:git-check-ref-format[1]).
94
95OPTIONS
96-------
97
98The following options are specific to `git refs migrate`:
99
100`--ref-storage-format=<format>`::
101 The ref storage format to migrate the ref store to. Can be one of:
102+
103include::ref-storage-format.adoc[]
104
105`--ref-format=<format>`::
106Deprecated alias of `--ref-storage-format=<format>`.
107
108`--dry-run`::
109 Perform the migration, but do not modify the repository. The migrated
110 refs will be written into a separate directory that can be inspected
111 separately. The name of the directory will be reported on stdout. This
112 can be used to double check that the migration works as expected before
113 performing the actual migration.
114
115`--reflog`::
116`--no-reflog`::
117 Choose between migrating the reflog data to the new backend,
118 and discarding them. The default is "--reflog", to migrate.
119
120The following options are specific to `git refs verify`:
121
122`--strict`::
123 Enable stricter error checking. This will cause warnings to be
124 reported as errors. See linkgit:git-fsck[1].
125
126`--verbose`::
127 When verifying the reference database consistency, be chatty.
128
129The following options are specific to 'git refs list':
130
131include::for-each-ref-options.adoc[]
132
133The following options are specific to 'git refs optimize':
134
135include::pack-refs-options.adoc[]
136
137The following options are specific to commands which write references:
138
139`--create-reflog`::
140 Create a reflog for the reference even if one would not ordinarily be
141 created.
142
143`--message=<reason>`::
144 Use the given <reason> string for the reflog entry associated with the
145 update. An empty message is rejected.
146
147`--no-deref`::
148 Operate on <ref> itself rather than the reference it points to via a
149 symbolic ref.
150
151GIT
152---
153Part of the linkgit:git[1] suite