意外删除.git文件夹 [英] Accidentally deleted the .git folder

查看:93
本文介绍了意外删除.git文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照Heroku上的指示试图找出我应用程序的slu size大小。


$ b


您的slu size大小显示在成功编译结束。您
可以粗略地估算出本地的slu size大小,方法是重新检出
您的应用程序,删除.git目录并运行du-hsc。



$ du -hsc | grep总计
总计290万美元

通过全新检查您的应用程序,我认为这只是简单地做git checkout -b测试。所以我这样做了,然后我rm -rf .git删除.git文件夹。并做了-hsc来获得我的slu size大小。我确实得到了它,但是当我试图让git结帐主人。它说我没有在这个文件夹中的git仓库。 - 现在我的应用程序git推送到heroku上的位置和github上的位置。是否有可能我可以清楚地说出来,让事情恢复到之前我删除.git文件夹的状态?



感谢您的帮助!

解决方案

我不确定我是否明白您的意思,但听起来像您可以



有两种选择:

1。git clone 如果您有遥控器,您可以再次克隆它。



(OR)

2。如果您在本地更改了未提交的内容,请移动它们,执行克隆操作,将更改的文件复制回目录中,然后提交并推送。


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!

解决方案

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.

这篇关于意外删除.git文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆