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