1

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!

Nik So
  • 16,683
  • 21
  • 74
  • 108

1 Answers1

4

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.

Community
  • 1
  • 1
Rob
  • 12,659
  • 4
  • 39
  • 56
  • Okay,basically,in the terminal, in my app's root, I did rm -rf .git. and now my app's directory is not longer a git repository. BUT every file, in every sub-directory of my app is intact. I just wanted my repository back. And I know that I have the app running on Heroku AND on Github where I can pull and push. So I was looking for option to revive my local repository. – Nik So May 10 '12 at 02:54
  • Yeah if you have remotes you can just clone it again. 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. – Rob May 10 '12 at 03:02
  • 1
    If you don't have remotes, you're pretty well screwed. – robrich May 10 '12 at 06:19
  • Even without remotes, it's possible that you might be able to salvage the repo https://stackoverflow.com/a/65181667/1507124 – CervEd Dec 07 '20 at 12:24