Add a few more values for receive.denyCurrentBranch
[git/dscho.git] / Documentation / git-symbolic-ref.txt
bloba45d4c4f29635a4fdcdeb2d15950925313920741
1 git-symbolic-ref(1)
2 ===================
4 NAME
5 ----
6 git-symbolic-ref - Read and modify symbolic refs
8 SYNOPSIS
9 --------
10 [verse]
11 'git symbolic-ref' [-q] [-m <reason>] <name> [<ref>]
13 DESCRIPTION
14 -----------
15 Given one argument, reads which branch head the given symbolic
16 ref refers to and outputs its path, relative to the `.git/`
17 directory.  Typically you would give `HEAD` as the <name>
18 argument to see which branch your working tree is on.
20 Given two arguments, creates or updates a symbolic ref <name> to
21 point at the given branch <ref>.
23 A symbolic ref is a regular file that stores a string that
24 begins with `ref: refs/`.  For example, your `.git/HEAD` is
25 a regular file whose contents is `ref: refs/heads/master`.
27 OPTIONS
28 -------
30 -q::
31 --quiet::
32         Do not issue an error message if the <name> is not a
33         symbolic ref but a detached HEAD; instead exit with
34         non-zero status silently.
36 -m::
37         Update the reflog for <name> with <reason>.  This is valid only
38         when creating or updating a symbolic ref.
40 NOTES
41 -----
42 In the past, `.git/HEAD` was a symbolic link pointing at
43 `refs/heads/master`.  When we wanted to switch to another branch,
44 we did `ln -sf refs/heads/newbranch .git/HEAD`, and when we wanted
45 to find out which branch we are on, we did `readlink .git/HEAD`.
46 But symbolic links are not entirely portable, so they are now
47 deprecated and symbolic refs (as described above) are used by
48 default.
50 'git symbolic-ref' will exit with status 0 if the contents of the
51 symbolic ref were printed correctly, with status 1 if the requested
52 name is not a symbolic ref, or 128 if another error occurs.
54 GIT
55 ---
56 Part of the linkgit:git[1] suite