git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Symbolic link documentation

From
Shawn O. Pearce <spearce@spearce.org>
Date
Sep 20, 2007, 17:25 UTC
Message-ID
<20070920172512.GT3099@spearce.org>
In-Reply-To
<70952A932255A2489522275A628B97C3052E98EB@xmb-sjc-233.amer.cisco.com>
"Matt Seitz (matseitz)" <matseitz@cisco.com> wrote:
> Where does the git user documentation discuss how git handles symbolic
> links?

About the only mention I can find appears to be in git-config where it talks a little bit about the core.symlinks configuration option.

But in general Git treats symlinks as though they were plain text files. The content of the "file" is the target of the symlink. Use `git-add link` to stage the symlink for the next commit (just like a file), `git-mv` to rename a symlink (just like a file), etc. Editing a symlink to point to a new target is just a matter of using the OS' tools (e.g. `ln -sf newdst link`).

So long as core.symlinks isn't set or is set to true Git will recreate the symlink upon checkout of the revision, just like it recreates plain text files.

-- 
Shawn.
Previous: Matt Seitz
Message 10 of 10 in “Symbolic link documentation”
  1. Matt Seitz (matseitz)Sep 20, 2007
  2. Johannes SchindelinSep 20, 2007
  3. Shawn O. PearceSep 20, 2007
  4. Matt Seitz (matseitz)Sep 20, 2007
  5. Shawn O. PearceSep 20, 2007
  6. Matt Seitz (matseitz)Sep 20, 2007
  7. Shawn O. PearceSep 20, 2007
  8. Johannes SchindelinSep 20, 2007
  9. Matt SeitzSep 20, 2007
  10. Shawn O. PearceSep 20, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.