Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/Documentation/git-refs.adoc # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / Documentation / git-refs.adoc` 153 lines ยท 4998 bytes Raw Blame History 1 git-refs(1) 2 =========== 3 4 NAME 5 ---- 6 git-refs - Low-level access to refs 7 8 9 SYNOPSIS 10 -------- 11 [synopsis] 12 git refs migrate --ref-storage-format= [--no-reflog] [--dry-run] 13 git refs verify [--strict] [--verbose] 14 git refs optimize [--all] [--no-prune] [--auto] [--include ] [--exclude ] 15 git refs list [--count=] [--shell|--perl|--python|--tcl] 16 [(--sort=)...] [--format=] 17 [--include-root-refs] [--points-at=] 18 [--merged[=]] [--no-merged[=]] 19 [--contains[=]] [--no-contains[=]] 20 [(--exclude=)...] [--start-after=] 21 [ --stdin | (...)] 22 git refs exists 23 git refs create [--message=] [--no-deref] [--create-reflog] 24 git refs delete [--message=] [--no-deref] [] 25 git refs update [--message=] [--no-deref] [--create-reflog] [] 26 git refs rename [--message=] 27 28 DESCRIPTION 29 ----------- 30 31 This command provides low-level access to refs. 32 33 COMMANDS 34 -------- 35 36 `migrate`:: 37 Migrate ref store between different formats. 38 + 39 [WARNING] 40 -- 41 The 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 51 These 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 ``. 76 77 `delete`:: 78 Delete the given reference. This subcommand mirrors `git update-ref -d` 79 (see linkgit:git-update-ref[1]). When `` is given, the 80 reference is only deleted after verifying that it currently contains 81 ``. 82 83 `update`:: 84 Update the given reference to point at ``. If `` 85 is given, the reference is only updated after verifying that it 86 currently contains ``. As a special case, an all-zeroes 87 `` deletes the branch, whereas an all-zeroes `` 88 ensures that the branch does not yet exist. 89 90 `rename`:: 91 Rename the reference `` to ``. 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 95 OPTIONS 96 ------- 97 98 The following options are specific to `git refs migrate`: 99 100 `--ref-storage-format=`:: 101 The ref storage format to migrate the ref store to. Can be one of: 102 + 103 include::ref-storage-format.adoc[] 104 105 `--ref-format=`:: 106 Deprecated alias of `--ref-storage-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 120 The 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 129 The following options are specific to 'git refs list': 130 131 include::for-each-ref-options.adoc[] 132 133 The following options are specific to 'git refs optimize': 134 135 include::pack-refs-options.adoc[] 136 137 The 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=`:: 144 Use the given string for the reflog entry associated with the 145 update. An empty message is rejected. 146 147 `--no-deref`:: 148 Operate on itself rather than the reference it points to via a 149 symbolic ref. 150 151 GIT 152 --- 153 Part of the linkgit:git[1] suite