I have the content of a huge project (with some changes) but not the Git database. One could get to the same situation for example like this:
git clone <...>/repo.git
cd repo
echo "Blah" > new_file.txt
rm .git
Since my repo is huge and all the project files are still there, I do not want to re-clone everything. How can I get back to a normal situation, where I would be able to commit and push my new_file.txt
?
I tried searching in general and among other questions here but nothing seems to provide the answer for this specific situation.
git clone --no-checkout
into another directory, say dir
.dir/.git
to your repo.git reset
.