问题
I was following an instruction on Heroku to try to find out the slug size of my app
Your slug size is displayed at the end of a successful compile. You can roughly estimate slug size locally by doing a fresh checkout of your app, deleting the .git directory, and running du -hsc.
$ du -hsc | grep total 2.9M total
By "fresh checkout of your app", I thought it meant just simply do git checkout -b test. So I did that, then i rm -rf .git to delete the .git folder. and did the du -hsc to get my slug size. I did get it, but when I tried to git checkout master. It says I don't have a git repository in this folder. -- Now I do have my app git push to both a location on heroku and a location on github. Is it possible that I can, well, to speak plainly, to make things return to what they were before I deleted the .git folder?
Thank you for helping out!
回答1:
I'm not sure if I understand exactly what you mean but it sounds like you can just git clone to get it back.
Two options:
1. if you have remotes you can just clone it again.
(OR)
2. If you have non committed changed locally then move them, do your clone, copy the changed files back into the directory, then commit and push.
来源:https://stackoverflow.com/questions/10526849/accidentally-deleted-the-git-folder