Skip excessive blank lines before commit body
[git/dscho.git] / Documentation / git-symbolic-ref.txt
blob4bc35a1d4bfce9b92394ba0f3e98ed9943f66e2e
1 git-symbolic-ref(1)
2 ===================
4 NAME
5 ----
6 git-symbolic-ref - read and modify symbolic refs
8 SYNOPSIS
9 --------
10 'git-symbolic-ref' <name> [<ref>]
12 DESCRIPTION
13 -----------
14 Given one argument, reads which branch head the given symbolic
15 ref refers to and outputs its path, relative to the `.git/`
16 directory.  Typically you would give `HEAD` as the <name>
17 argument to see on which branch your working tree is on.
19 Give two arguments, create or update a symbolic ref <name> to
20 point at the given branch <ref>.
22 A symbolic ref is a regular file that stores a string that
23 begins with `ref: refs/`.  For example, your `.git/HEAD` is
24 a regular file whose contents is `ref: refs/heads/master`.
26 NOTES
27 -----
28 In the past, `.git/HEAD` was a symbolic link pointing at
29 `refs/heads/master`.  When we wanted to switch to another branch,
30 we did `ln -sf refs/heads/newbranch .git/HEAD`, and when we wanted
31 to find out which branch we are on, we did `readlink .git/HEAD`.
32 This was fine, and internally that is what still happens by
33 default, but on platforms that do not have working symlinks,
34 or that do not have the `readlink(1)` command, this was a bit
35 cumbersome.  On some platforms, `ln -sf` does not even work as
36 advertised (horrors).  Therefore symbolic links are now deprecated
37 and symbolic refs are used by default.
39 Author
40 ------
41 Written by Junio C Hamano <junkio@cox.net>
43 GIT
44 ---
45 Part of the gitlink:git[7] suite