So I’ve got a local repository with two branches: master and shop. I’ve also got a bare repository, and a remote repository. I can push and pull fine between all of these, but there are some files that keep getting lost. I’m doing the following:
From my local root:
git push barereposerver shop
All is well. Whoo, we pushed there. And then from the remote root, after doing a git init and git remote add bare ssh://blahblahblah/blah.git, I’m doing:
git pull bare shop
But for some reason, I’ve got a few files that aren’t coming across.
I know I haven’t given much information, but I’m very new to git, and I don’t know the right terminology yet. I’d love for you to ask me some questions and see if you can help me through this one. Thanks so much!
Update: a sideways version of what I’m looking to do. I’m looking to get from other -> other, via a bare repo: http://droplr.com/wEB1q
From your diagram, it looks like what you have done is:
Which is:
Well, did you actually add and then commit those files, before attempting to push your local repo? (see this question for instance)
From the comments, here is how we tracked together the root cause of this issue:
Another way to troubleshoot is to note the SHA1 of the local commit (which contains your files) and the SHA1 of what you are getting on the remote side (after pulling from bare): if it is not the same, that explain the different content, but you can also search that SHA1 (obtained on remote) on the bare repo and on the local repo, to check to which commit that SHA1 (which lacks some files) refers to.
if the SHA1 is the same, then the missing directories should not be part of the local commit.
Try to clone your local repo in a second local repo and check if you see the same content in both local repos.
Right now, the fact that the directories are missing in a local clone is proof enough that those directories are not part of the local repo commits in the first place. Are those directories empty? (because even if added, they wouldn’t be committed)
This is actually an important design decision, part of what makes Git a file content management system (see Popularity of Git and Git versus SVN).
Those directories, once added with a .gitignore in them, are now pushed/pulled successfully.