I'm using folder containing Software Development Kit (SDK), and tried to back it up with git into another folder in my laptop which I use as a git remote.
I used git add *
.
It seemed that all worked well, I received no error or warning. So then i cloned the remote into another folder, and tried to compile, but got an error saying that files are missing. It turned out that a folder is missing in git.
Any idea what I did wrong ?
cd /home/ubuntu/backup
mkdir yamit
cd yamit
git init
git add *
git commit -m "first backup"
git remote add yamit /home/ubuntu/backup/yamit.git
git push -u yamit master
Whenever you have a missing resource after a git add, you can easily check if it is part of any .gitignore
with a git check-ignore
(git 1.8.4+):
git check-ignore -v path/to/missing/ressource
Simply modify the .gitignore
by removing its line ignore the resource you need.
Then add and commit again.
If you don't want to modify the .gitignore
file, then a
git add -f .
# or
git add -f path/to/missing/*
That can force those ignored resources to be added to the index anyway.
Ok. I've resolved this. Just needed to call add with force into repository.
git add * -f
Yet, I still don't unedrstand why Git decided to ignore the folder when trying without forcing ( it's non empty folder).
Thanks. Ran
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With