summaryrefslogtreecommitdiff
path: root/Documentation/git-update-ref.txt
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-09-27 01:58:57 -0700
committerJunio C Hamano <junkio@cox.net>2006-09-27 02:01:42 -0700
commitac5409e420e5fdd7c4a381f873ffcedfb83d7117 (patch)
treeeae6bec434639c43b324005b5c0b88bfe5889834 /Documentation/git-update-ref.txt
parent4431fcc4b134ae501e3e57dc568ae4f031e57898 (diff)
downloadgit-ac5409e420e5fdd7c4a381f873ffcedfb83d7117.tar.gz
update-ref: -d flag and ref creation safety.
This adds -d flag to update-ref to allow safe deletion of ref. Before deleting it, the command checks if the given <oldvalue> still matches the value the caller thought the ref contained. Similarly, it also accepts 0{40} or an empty string as <oldvalue> to allow safe creation of a new ref. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'Documentation/git-update-ref.txt')
-rw-r--r--Documentation/git-update-ref.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/Documentation/git-update-ref.txt b/Documentation/git-update-ref.txt
index e062030e91..71bcb7954f 100644
--- a/Documentation/git-update-ref.txt
+++ b/Documentation/git-update-ref.txt
@@ -7,7 +7,7 @@ git-update-ref - update the object name stored in a ref safely
SYNOPSIS
--------
-'git-update-ref' [-m <reason>] <ref> <newvalue> [<oldvalue>]
+'git-update-ref' [-m <reason>] (-d <ref> <oldvalue> | <ref> <newvalue> [<oldvalue>])
DESCRIPTION
-----------
@@ -20,7 +20,9 @@ possibly dereferencing the symbolic refs, after verifying that
the current value of the <ref> matches <oldvalue>.
E.g. `git-update-ref refs/heads/master <newvalue> <oldvalue>`
updates the master branch head to <newvalue> only if its current
-value is <oldvalue>.
+value is <oldvalue>. You can specify 40 "0" or an empty string
+as <oldvalue> 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
@@ -49,6 +51,10 @@ 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 <oldvalue>.
+
+
Logging Updates
---------------
If config parameter "core.logAllRefUpdates" is true or the file