/usr/share/doc/git
git-update-ref(1) ================= NAME ---- git-update-ref - Update the object name stored in a ref safely SYNOPSIS -------- [verse] 'git update-ref' [-m <reason>] [--no-deref] (-d <ref> [<old-oid>] | [--create-reflog] <ref> <new-oid> [<old-oid>] | --stdin [-z]) DESCRIPTION ----------- Given two arguments, stores the <new-oid> in the <ref>, possibly dereferencing the symbolic refs. E.g. `git update-ref HEAD <new-oid>` updates the current branch head to the new object. Given three arguments, stores the <new-oid> in the <ref>, possibly dereferencing the symbolic refs, after verifying that the current value of the <ref> matches <old-oid>. E.g. `git update-ref refs/heads/master <new-oid> <old-oid>` updates the master branch head to <new-oid> only if its current value is <old-oid>. You can specify 40 "0" or an empty string as <old-oid> to make sure that the ref you are creating does not exist. It also allows a "ref" file to be a symbolic pointer to another ref file by starting with the four-byte header sequence of "ref:". More importantly, it allows the update of a ref file to follow these symbolic pointers, whether they are symlinks or these "regular file symbolic refs". It follows *real* symlinks only if they start with "refs/": otherwise it will just try to read them and update them as a regular file (i.e. it will allow the filesystem to follow them, but will overwrite such a symlink to somewhere else with a regular filename). If --no-deref is given, <ref> itself is overwritten, rather than the result of following the symbolic pointers. In general, using git update-ref HEAD "$head" should be a _lot_ safer than doing echo "$head" > "$GIT_DIR/HEAD" both from a symlink following standpoint *and* an error checking standpoint. The "refs/" rule for symlinks means that symlinks that point to "outside" the tree are safe: they'll be followed for reading but not for writing (so we'll never write through a ref symlink to some other tree, if you have copied a whole archive by creating a symlink tree). With `-d` flag, it deletes the named <ref> after verifying it still contains <old-oid>. With `--stdin`, update-ref reads instructions from standard input and performs all modifications together. Specify commands of the form: update SP <ref> SP <new-oid> [SP <old-oid>] LF create SP <ref> SP <new-oid> LF delete SP <ref> [SP <old-oid>] LF verify SP <ref> [SP <old-oid>] LF symref-update SP <ref> SP <new-target> [SP (ref SP <old-target> | oid SP <old-oid>)] LF symref-create SP <ref> SP <new-target> LF symref-delete SP <ref> [SP <old-target>] LF symref-verify SP <ref> [SP <old-target>] LF option SP <opt> LF start LF prepare LF commit LF abort LF With `--create-reflog`, update-ref will create a reflog for each ref even if one would not ordinarily be created. Quote fields containing whitespace as if they were strings in C source code; i.e., surrounded by double-quotes and with backslash escapes. Use 40 "0" characters or the empty string to specify a zero value. To specify a missing value, omit the value and its preceding SP entirely. Alternatively, use `-z` to specify in NUL-terminated format, without quoting: update SP <ref> NUL <new-oid> NUL [<old-oid>] NUL create SP <ref> NUL <new-oid> NUL delete SP <ref> NUL [<old-oid>] NUL verify SP <ref> NUL [<old-oid>] NUL symref-update SP <ref> NUL <new-target> [NUL (ref NUL <old-target> | oid NUL <old-oid>)] NUL symref-create SP <ref> NUL <new-target> NUL symref-delete SP <ref> [NUL <old-target>] NUL symref-verify SP <ref> [NUL <old-target>] NUL option SP <opt> NUL start NUL prepare NUL commit NUL abort NUL In this format, use 40 "0" to specify a zero value, and use the empty string to specify a missing value. In either format, values can be specified in any form that Git recognizes as an object name. Commands in any other format or a repeated <ref> produce an error. Command meanings are: update:: Set <ref> to <new-oid> after verifying <old-oid>, if given. Specify a zero <new-oid> to ensure the ref does not exist after the update and/or a zero <old-oid> to make sure the ref does not exist before the update. create:: Create <ref> with <new-oid> after verifying it does not exist. The given <new-oid> may not be zero. delete:: Delete <ref> after verifying it exists with <old-oid>, if given. If given, <old-oid> may not be zero. symref-update:: Set <ref> to <new-target> after verifying <old-target> or <old-oid>, if given. Specify a zero <old-oid> to ensure that the ref does not exist before the update. verify:: Verify <ref> against <old-oid> but do not change it. If <old-oid> is zero or missing, the ref must not exist. symref-create: Create symbolic ref <ref> with <new-target> after verifying it does not exist. symref-delete:: Delete <ref> after verifying it exists with <old-target>, if given. symref-verify:: Verify symbolic <ref> against <old-target> but do not change it. If <old-target> is missing, the ref must not exist. Can only be used in `no-deref` mode. option:: Modify the behavior of the next command naming a <ref>. The only valid option is `no-deref` to avoid dereferencing a symbolic ref. start:: Start a transaction. In contrast to a non-transactional session, a transaction will automatically abort if the session ends without an explicit commit. This command may create a new empty transaction when the current one has been committed or aborted already. prepare:: Prepare to commit the transaction. This will create lock files for all queued reference updates. If one reference could not be locked, the transaction will be aborted. commit:: Commit all reference updates queued for the transaction, ending the transaction. abort:: Abort the transaction, releasing all locks if the transaction is in prepared state. If all <ref>s can be locked with matching <old-oid>s simultaneously, all modifications are performed. Otherwise, no modifications are performed. Note that while each individual <ref> is updated or deleted atomically, a concurrent reader may still see a subset of the modifications. LOGGING UPDATES --------------- If config parameter "core.logAllRefUpdates" is true and the ref is one under "refs/heads/", "refs/remotes/", "refs/notes/", or a pseudoref like HEAD or ORIG_HEAD; or the file "$GIT_DIR/logs/<ref>" exists then `git update-ref` will append a line to the log file "$GIT_DIR/logs/<ref>" (dereferencing all symbolic refs before creating the log name) describing the change in ref value. Log lines are formatted as: oldsha1 SP newsha1 SP committer LF Where "oldsha1" is the 40 character hexadecimal value previously stored in <ref>, "newsha1" is the 40 character hexadecimal value of <new-oid> and "committer" is the committer's name, email address and date in the standard Git committer ident format. Optionally with -m: oldsha1 SP newsha1 SP committer TAB message LF Where all fields are as described above and "message" is the value supplied to the -m option. An update will fail (without changing <ref>) if the current user is unable to create a new log file, append to the existing log file or does not have committer information available. GIT --- Part of the linkgit:git[1] suite
.
Edit
..
Edit
BreakingChanges.txt
Edit
CODE_OF_CONDUCT.md
Edit
DecisionMaking.html
Edit
DecisionMaking.txt
Edit
MyFirstContribution.html
Edit
MyFirstContribution.txt
Edit
MyFirstObjectWalk.html
Edit
MyFirstObjectWalk.txt
Edit
README.md
Edit
RelNotes
Edit
ReviewingGuidelines.html
Edit
ReviewingGuidelines.txt
Edit
SubmittingPatches.html
Edit
SubmittingPatches.txt
Edit
ToolsForGit.html
Edit
ToolsForGit.txt
Edit
blame-options.txt
Edit
cmds-ancillaryinterrogators.txt
Edit
cmds-ancillarymanipulators.txt
Edit
cmds-developerinterfaces.txt
Edit
cmds-foreignscminterface.txt
Edit
cmds-guide.txt
Edit
cmds-mainporcelain.txt
Edit
cmds-plumbinginterrogators.txt
Edit
cmds-plumbingmanipulators.txt
Edit
cmds-purehelpers.txt
Edit
cmds-synchelpers.txt
Edit
cmds-synchingrepositories.txt
Edit
cmds-userinterfaces.txt
Edit
config.txt
Edit
contrib
Edit
date-formats.txt
Edit
diff-format.txt
Edit
diff-generate-patch.txt
Edit
diff-options.txt
Edit
docbook-xsl.css
Edit
docinfo.html
Edit
everyday.html
Edit
fetch-options.txt
Edit
fsck-msgids.txt
Edit
git-add.html
Edit
git-add.txt
Edit
git-am.html
Edit
git-am.txt
Edit
git-annotate.html
Edit
git-annotate.txt
Edit
git-apply.html
Edit
git-apply.txt
Edit
git-archive.html
Edit
git-archive.txt
Edit
git-bisect-lk2009.html
Edit
git-bisect-lk2009.txt
Edit
git-bisect.html
Edit
git-bisect.txt
Edit
git-blame.html
Edit
git-blame.txt
Edit
git-branch.html
Edit
git-branch.txt
Edit
git-bugreport.html
Edit
git-bugreport.txt
Edit
git-bundle.html
Edit
git-bundle.txt
Edit
git-cat-file.html
Edit
git-cat-file.txt
Edit
git-check-attr.html
Edit
git-check-attr.txt
Edit
git-check-ignore.html
Edit
git-check-ignore.txt
Edit
git-check-mailmap.html
Edit
git-check-mailmap.txt
Edit
git-check-ref-format.html
Edit
git-check-ref-format.txt
Edit
git-checkout-index.html
Edit
git-checkout-index.txt
Edit
git-checkout.html
Edit
git-checkout.txt
Edit
git-cherry-pick.html
Edit
git-cherry-pick.txt
Edit
git-cherry.html
Edit
git-cherry.txt
Edit
git-clean.html
Edit
git-clean.txt
Edit
git-clone.html
Edit
git-clone.txt
Edit
git-column.html
Edit
git-column.txt
Edit
git-commit-graph.html
Edit
git-commit-graph.txt
Edit
git-commit-tree.html
Edit
git-commit-tree.txt
Edit
git-commit.html
Edit
git-commit.txt
Edit
git-config.html
Edit
git-config.txt
Edit
git-contacts.html
Edit
git-contacts.txt
Edit
git-count-objects.html
Edit
git-count-objects.txt
Edit
git-credential-cache--daemon.html
Edit
git-credential-cache--daemon.txt
Edit
git-credential-cache.html
Edit
git-credential-cache.txt
Edit
git-credential-store.html
Edit
git-credential-store.txt
Edit
git-credential.html
Edit
git-credential.txt
Edit
git-describe.html
Edit
git-describe.txt
Edit
git-diagnose.html
Edit
git-diagnose.txt
Edit
git-diff-files.html
Edit
git-diff-files.txt
Edit
git-diff-index.html
Edit
git-diff-index.txt
Edit
git-diff-tree.html
Edit
git-diff-tree.txt
Edit
git-diff.html
Edit
git-diff.txt
Edit
git-difftool.html
Edit
git-difftool.txt
Edit
git-fast-export.html
Edit
git-fast-export.txt
Edit
git-fast-import.html
Edit
git-fast-import.txt
Edit
git-fetch-pack.html
Edit
git-fetch-pack.txt
Edit
git-fetch.html
Edit
git-fetch.txt
Edit
git-filter-branch.html
Edit
git-filter-branch.txt
Edit
git-fmt-merge-msg.html
Edit
git-fmt-merge-msg.txt
Edit
git-for-each-ref.html
Edit
git-for-each-ref.txt
Edit
git-for-each-repo.html
Edit
git-for-each-repo.txt
Edit
git-format-patch.html
Edit
git-format-patch.txt
Edit
git-fsck-objects.html
Edit
git-fsck-objects.txt
Edit
git-fsck.html
Edit
git-fsck.txt
Edit
git-fsmonitor--daemon.html
Edit
git-fsmonitor--daemon.txt
Edit
git-gc.html
Edit
git-gc.txt
Edit
git-get-tar-commit-id.html
Edit
git-get-tar-commit-id.txt
Edit
git-grep.html
Edit
git-grep.txt
Edit
git-hash-object.html
Edit
git-hash-object.txt
Edit
git-help.html
Edit
git-help.txt
Edit
git-hook.html
Edit
git-hook.txt
Edit
git-http-backend.html
Edit
git-http-backend.txt
Edit
git-http-fetch.html
Edit
git-http-fetch.txt
Edit
git-http-push.html
Edit
git-http-push.txt
Edit
git-imap-send.html
Edit
git-imap-send.txt
Edit
git-index-pack.html
Edit
git-index-pack.txt
Edit
git-init-db.html
Edit
git-init-db.txt
Edit
git-init.html
Edit
git-init.txt
Edit
git-interpret-trailers.html
Edit
git-interpret-trailers.txt
Edit
git-log.html
Edit
git-log.txt
Edit
git-ls-files.html
Edit
git-ls-files.txt
Edit
git-ls-remote.html
Edit
git-ls-remote.txt
Edit
git-ls-tree.html
Edit
git-ls-tree.txt
Edit
git-mailinfo.html
Edit
git-mailinfo.txt
Edit
git-mailsplit.html
Edit
git-mailsplit.txt
Edit
git-maintenance.html
Edit
git-maintenance.txt
Edit
git-merge-base.html
Edit
git-merge-base.txt
Edit
git-merge-file.html
Edit
git-merge-file.txt
Edit
git-merge-index.html
Edit
git-merge-index.txt
Edit
git-merge-one-file.html
Edit
git-merge-one-file.txt
Edit
git-merge-tree.html
Edit
git-merge-tree.txt
Edit
git-merge.html
Edit
git-merge.txt
Edit
git-mergetool--lib.html
Edit
git-mergetool--lib.txt
Edit
git-mergetool.html
Edit
git-mergetool.txt
Edit
git-mktag.html
Edit
git-mktag.txt
Edit
git-mktree.html
Edit
git-mktree.txt
Edit
git-multi-pack-index.html
Edit
git-multi-pack-index.txt
Edit
git-mv.html
Edit
git-mv.txt
Edit
git-name-rev.html
Edit
git-name-rev.txt
Edit
git-notes.html
Edit
git-notes.txt
Edit
git-pack-objects.html
Edit
git-pack-objects.txt
Edit
git-pack-redundant.html
Edit
git-pack-redundant.txt
Edit
git-pack-refs.html
Edit
git-pack-refs.txt
Edit
git-patch-id.html
Edit
git-patch-id.txt
Edit
git-prune-packed.html
Edit
git-prune-packed.txt
Edit
git-prune.html
Edit
git-prune.txt
Edit
git-pull.html
Edit
git-pull.txt
Edit
git-push.html
Edit
git-push.txt
Edit
git-quiltimport.html
Edit
git-quiltimport.txt
Edit
git-range-diff.html
Edit
git-range-diff.txt
Edit
git-read-tree.html
Edit
git-read-tree.txt
Edit
git-rebase.html
Edit
git-rebase.txt
Edit
git-receive-pack.html
Edit
git-receive-pack.txt
Edit
git-reflog.html
Edit
git-reflog.txt
Edit
git-refs.html
Edit
git-refs.txt
Edit
git-remote-ext.html
Edit
git-remote-ext.txt
Edit
git-remote-fd.html
Edit
git-remote-fd.txt
Edit
git-remote-helpers.html
Edit
git-remote.html
Edit
git-remote.txt
Edit
git-repack.html
Edit
git-repack.txt
Edit
git-replace.html
Edit
git-replace.txt
Edit
git-replay.html
Edit
git-replay.txt
Edit
git-request-pull.html
Edit
git-request-pull.txt
Edit
git-rerere.html
Edit
git-rerere.txt
Edit
git-reset.html
Edit
git-reset.txt
Edit
git-restore.html
Edit
git-restore.txt
Edit
git-rev-list.html
Edit
git-rev-list.txt
Edit
git-rev-parse.html
Edit
git-rev-parse.txt
Edit
git-revert.html
Edit
git-revert.txt
Edit
git-rm.html
Edit
git-rm.txt
Edit
git-send-pack.html
Edit
git-send-pack.txt
Edit
git-sh-i18n--envsubst.html
Edit
git-sh-i18n--envsubst.txt
Edit
git-sh-i18n.html
Edit
git-sh-i18n.txt
Edit
git-sh-setup.html
Edit
git-sh-setup.txt
Edit
git-shell.html
Edit
git-shell.txt
Edit
git-shortlog.html
Edit
git-shortlog.txt
Edit
git-show-branch.html
Edit
git-show-branch.txt
Edit
git-show-index.html
Edit
git-show-index.txt
Edit
git-show-ref.html
Edit
git-show-ref.txt
Edit
git-show.html
Edit
git-show.txt
Edit
git-sparse-checkout.html
Edit
git-sparse-checkout.txt
Edit
git-stage.html
Edit
git-stage.txt
Edit
git-stash.html
Edit
git-stash.txt
Edit
git-status.html
Edit
git-status.txt
Edit
git-stripspace.html
Edit
git-stripspace.txt
Edit
git-submodule.html
Edit
git-submodule.txt
Edit
git-switch.html
Edit
git-switch.txt
Edit
git-symbolic-ref.html
Edit
git-symbolic-ref.txt
Edit
git-tag.html
Edit
git-tag.txt
Edit
git-tools.html
Edit
git-tools.txt
Edit
git-unpack-file.html
Edit
git-unpack-file.txt
Edit
git-unpack-objects.html
Edit
git-unpack-objects.txt
Edit
git-update-index.html
Edit
git-update-index.txt
Edit
git-update-ref.html
Edit
git-update-ref.txt
Edit
git-update-server-info.html
Edit
git-update-server-info.txt
Edit
git-upload-archive.html
Edit
git-upload-archive.txt
Edit
git-upload-pack.html
Edit
git-upload-pack.txt
Edit
git-var.html
Edit
git-var.txt
Edit
git-verify-commit.html
Edit
git-verify-commit.txt
Edit
git-verify-pack.html
Edit
git-verify-pack.txt
Edit
git-verify-tag.html
Edit
git-verify-tag.txt
Edit
git-version.html
Edit
git-version.txt
Edit
git-web--browse.html
Edit
git-web--browse.txt
Edit
git-whatchanged.html
Edit
git-whatchanged.txt
Edit
git-worktree.html
Edit
git-worktree.txt
Edit
git-write-tree.html
Edit
git-write-tree.txt
Edit
git.html
Edit
git.txt
Edit
gitattributes.html
Edit
gitattributes.txt
Edit
gitcli.html
Edit
gitcli.txt
Edit
gitcore-tutorial.html
Edit
gitcore-tutorial.txt
Edit
gitcredentials.html
Edit
gitcredentials.txt
Edit
gitdiffcore.html
Edit
gitdiffcore.txt
Edit
giteveryday.html
Edit
giteveryday.txt
Edit
gitfaq.html
Edit
gitfaq.txt
Edit
gitformat-bundle.html
Edit
gitformat-bundle.txt
Edit
gitformat-chunk.html
Edit
gitformat-chunk.txt
Edit
gitformat-commit-graph.html
Edit
gitformat-commit-graph.txt
Edit
gitformat-index.html
Edit
gitformat-index.txt
Edit
gitformat-pack.html
Edit
gitformat-pack.txt
Edit
gitformat-signature.html
Edit
gitformat-signature.txt
Edit
gitglossary.html
Edit
gitglossary.txt
Edit
githooks.html
Edit
githooks.txt
Edit
gitignore.html
Edit
gitignore.txt
Edit
gitmailmap.html
Edit
gitmailmap.txt
Edit
gitmodules.html
Edit
gitmodules.txt
Edit
gitnamespaces.html
Edit
gitnamespaces.txt
Edit
gitpacking.html
Edit
gitpacking.txt
Edit
gitprotocol-capabilities.html
Edit
gitprotocol-capabilities.txt
Edit
gitprotocol-common.html
Edit
gitprotocol-common.txt
Edit
gitprotocol-http.html
Edit
gitprotocol-http.txt
Edit
gitprotocol-pack.html
Edit
gitprotocol-pack.txt
Edit
gitprotocol-v2.html
Edit
gitprotocol-v2.txt
Edit
gitremote-helpers.html
Edit
gitremote-helpers.txt
Edit
gitrepository-layout.html
Edit
gitrepository-layout.txt
Edit
gitrevisions.html
Edit
gitrevisions.txt
Edit
gitsubmodules.html
Edit
gitsubmodules.txt
Edit
gittutorial-2.html
Edit
gittutorial-2.txt
Edit
gittutorial.html
Edit
gittutorial.txt
Edit
gitworkflows.html
Edit
gitworkflows.txt
Edit
glossary-content.txt
Edit
howto
Edit
howto-index.html
Edit
howto-index.txt
Edit
i18n.txt
Edit
line-range-format.txt
Edit
line-range-options.txt
Edit
merge-options.txt
Edit
merge-strategies.txt
Edit
mergetools-diff.txt
Edit
mergetools-merge.txt
Edit
object-format-disclaimer.txt
Edit
pretty-formats.txt
Edit
pretty-options.txt
Edit
pull-fetch-param.txt
Edit
ref-reachability-filters.txt
Edit
ref-storage-format.txt
Edit
rerere-options.txt
Edit
rev-list-description.txt
Edit
rev-list-options.txt
Edit
revisions.txt
Edit
scalar.html
Edit
scalar.txt
Edit
sequencer.txt
Edit
signoff-option.txt
Edit
technical
Edit
trace2-target-values.txt
Edit
transfer-data-leaks.txt
Edit
urls-remotes.txt
Edit
urls.txt
Edit
user-manual.html
Edit
user-manual.txt
Edit