I just made a simple script and created a new repository for it on GitHub. After initializing the local repo, moving the script to the repository and pull
ing the GitHub repository (containing only a README.md
file), the script was gone. Is this normal behavior? And is there some way to restore the file?
Here are the commands, as executed:
$ mkgithub ~/dev/cr2meta2jpg
Initialized empty Git repository in /home/username/dev/cr2meta2jpg/.git/
$ mv test.sh ~/dev/cr2meta2jpg/cr2meta2jpg.sh
$ cd ~/dev/cr2meta2jpg/
$ ls
cr2meta2jpg.sh
$ git pull
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From github.com:l0b0/cr2meta2jpg
* [new branch] master -> origin/master
$ ls
README.md
git fsck --lost-found
. This will save the dangling blobs to.git/lost-found/other
. Either way, the file names are lost. The filenames will be the hashes of the objects. – JonnyJD Dec 18 '12 at 13:43