I had a git repository and for some reason I want to do these things:
- delete remote repository (repo)
- From the existing directory (which was earlier corresponds to the deleted remote repo), I would like to create a new git repo.
So, to perform this I did following:
- Deleted old remote repository
- Created a new remote repository, and
- Finally, run the following set of commands:
rm -rf .git git init ls -a git add * git pull git@github.com:arunhep/DYAnalysis.git master git commit -m "first commit" git remote add origin git@github.com:arunhep/DYAnalysis.git git status -s git status git push
But at the end what do I see is that there is nothing on the github.com nor in my present working directory. Somehow I lost all the codes.
One more thing I noticed that I added few thing like *.so, *.pyc, *.pdf, etc in the .gitignore file. So, all these files are there but not the actual files like *.C, *.py, etc.
What I did wrong so that this happened? and Is there any way to recover all the lost files?
[Update] I found how to recover all the files at link:
git deleted everything, how to recover files and folders
But, still not able to get why this happened?