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

git stash destroys hard links

From
Steven Penny <svnpenn@gmail.com>
Date
May 22, 2012, 04:24 UTC
Message-ID
<CAAXzdLWadNg9d_i8fZTawaxYm3ytcGCT4pzeth=LxrQYEO-3ww@mail.gmail.com>

I dont know if this is even fixable, but I wanted to at least mention it. Performing a git stash will destroy any hard links and replace them with simply a copy of the file.

$ mkdir test $ cd test $ git init $ touch foobar.sh $ git add -A $ git commit -m 'first commit'

$ ln foobar.sh foobar-link.sh

$ ls -l total 0 -rw-r--r-- 2 Steven None 0 May 21 23:18 foobar.sh -rw-r--r-- 2 Steven None 0 May 21 23:18 foobar-link.sh

$ git stash -u $ git stash pop

$ ls -l total 0 -rw-r--r-- 1 Steven None 0 May 21 23:18 foobar.sh -rw-r--r-- 1 Steven None 0 May 21 23:18 foobar-link.sh

Next: Junio C Hamano
Message 1 of 3 in “git stash destroys hard links”
  1. Steven PennyMay 22, 2012
  2. Junio C HamanoMay 22, 2012
  3. Angus HammondMay 22, 2012

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.