Reputation: 12514
I have just recently backed-up my XCode C++ project on my pendrive, using
rsync -avu
Since then, the version control for my project is grayed-out on every files, I can modify the files and not see the "M" nor the "A" sign. The only files still having version-control working "shared" files for which it works correctly. (Those shared files belong to a different project called "Shared").
I have tried git commit -m
, git add .
and even git init
where the files were. Nothing worked.
Can you please help restoring version control for my project?
UPDATE:
Answers for the questions in commens (and answers):
git commit -m "sth"
as "sth" az a commit. I have a single branch: master..git
in the project folder.git log
is working, showing the same as XCode Organiser-repository pane.I think the XCode just can't synchronise with the git for some reason, and I don't know how to correct that.
Upvotes: 1
Views: 262
Reputation: 13378
First off, this is not an answer that will fix your problem, I just try to provide some help that might get you closer to a diagnosis.
Git stores its files in a folder named .git
. Check if this folder is present in your project. If it's not then your Git repository is gone.
Next, try some basic command such as git log
. For this to work, you must first cd
to your project folder (or a subfolder thereof), because whenever you run a Git command it will look for the .git
folder in the cwd or a parent folder. If git log
does not work then your Git repository is broken in some way. Someone else will have to step in to further diagnose the problem, as I am no expert on this subject.
Finally, you should also check whether your rsync
command has really sync'ed your project's .git
folder with the backup's .git
folder. Use this command:
diff -rq /path/to/project/.git /path/to/backup/.git
If there is no difference (as I would expect if rsync
has worked correctly) then the problem with your Git repository is both in your project and in your backup. If there are differences then it might be worthwile to try your next steps on a copy of the backup (it should be fine to make the copy in the Finder).
Good luck.
Upvotes: 1