| 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-format=<format> [--no-reflog] [--dry-run] |
| 13 | git refs verify [--strict] [--verbose] |
| 14 | git refs list [--count=<count>] [--shell|--perl|--python|--tcl] |
| 15 | [(--sort=<key>)...] [--format=<format>] |
| 16 | [--include-root-refs] [--points-at=<object>] |
| 17 | [--merged[=<object>]] [--no-merged[=<object>]] |
| 18 | [--contains[=<object>]] [--no-contains[=<object>]] |
| 19 | [(--exclude=<pattern>)...] [--start-after=<marker>] |
| 20 | [ --stdin | (<pattern>...)] |
| 21 | git refs exists <ref> |
| 22 | git refs optimize [--all] [--no-prune] [--auto] [--include <pattern>] [--exclude <pattern>] |
| 23 | git refs create [--message=<reason>] [--no-deref] [--create-reflog] <ref> <new-value> |
| 24 | git refs delete [--message=<reason>] [--no-deref] <ref> [<old-value>] |
| 25 | git refs update [--message=<reason>] [--no-deref] [--create-reflog] <ref> <new-value> [<old-value>] |
| 26 | git refs rename [--message=<reason>] <old-ref> <new-ref> |
| 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 | [CAUTION] |
| 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 | `<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 | |
| 95 | OPTIONS |
| 96 | ------- |
| 97 | |
| 98 | The following options are specific to `git refs migrate`: |
| 99 | |
| 100 | `--ref-format=<format>`:: |
| 101 | The ref format to migrate the ref store to. Can be one of: |
| 102 | + |
| 103 | include::ref-storage-format.adoc[] |
| 104 | |
| 105 | `--dry-run`:: |
| 106 | Perform the migration, but do not modify the repository. The migrated |
| 107 | refs will be written into a separate directory that can be inspected |
| 108 | separately. The name of the directory will be reported on stdout. This |
| 109 | can be used to double check that the migration works as expected before |
| 110 | performing the actual migration. |
| 111 | |
| 112 | `--reflog`:: |
| 113 | `--no-reflog`:: |
| 114 | Choose between migrating the reflog data to the new backend, |
| 115 | and discarding them. The default is "--reflog", to migrate. |
| 116 | |
| 117 | The following options are specific to `git refs verify`: |
| 118 | |
| 119 | `--strict`:: |
| 120 | Enable stricter error checking. This will cause warnings to be |
| 121 | reported as errors. See linkgit:git-fsck[1]. |
| 122 | |
| 123 | `--verbose`:: |
| 124 | When verifying the reference database consistency, be chatty. |
| 125 | |
| 126 | The following options are specific to 'git refs list': |
| 127 | |
| 128 | include::for-each-ref-options.adoc[] |
| 129 | |
| 130 | The following options are specific to 'git refs optimize': |
| 131 | |
| 132 | include::pack-refs-options.adoc[] |
| 133 | |
| 134 | The following options are specific to commands which write references: |
| 135 | |
| 136 | `--create-reflog`:: |
| 137 | Create a reflog for the reference even if one would not ordinarily be |
| 138 | created. |
| 139 | |
| 140 | `--message=<reason>`:: |
| 141 | Use the given <reason> string for the reflog entry associated with the |
| 142 | update. An empty message is rejected. |
| 143 | |
| 144 | `--no-deref`:: |
| 145 | Operate on <ref> itself rather than the reference it points to via a |
| 146 | symbolic ref. |
| 147 | |
| 148 | GIT |
| 149 | --- |
| 150 | Part of the linkgit:git[1] suite |