git 如何重新启动git repo?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9427251/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to restart git repo?
提问by Damien Roche
I've fetched a repo from one of my old projects and I've edited the files so I can use this as a 'skeleton' for new projects. Say I'm here:
我从我的一个旧项目中获取了一个 repo 并编辑了这些文件,因此我可以将其用作新项目的“骨架”。说我在这里:
/skeleton/framework
/骨架/框架
I already have the repo there, edited. How would I go about restarting this repo with those files in that directory? What shouldI have done?
我已经在那里有了 repo,已编辑。我将如何使用该目录中的这些文件重新启动此存储库?我应该怎么做?
All I did was pull the repo and edit and push to a different named repo (skeleton.git). Trouble is, this repo obviously contains all the history of the repo I pulled from.
我所做的只是拉取 repo 并编辑并推送到不同的命名 repo (skeleton.git)。问题是,这个 repo 显然包含我从中提取的 repo 的所有历史记录。
回答by Marian Theisen
If you just want to keep your current working tree, and lose all git history etc. you can do
如果您只想保留当前的工作树,并丢失所有 git 历史记录等,您可以这样做
rm -rf .git
git init .
回答by thelastinuit
In my case I had to remove .git and all trace. then copy the app to another location in the hard drive and start all over again (git init . and so on...)
就我而言,我必须删除 .git 和所有跟踪。然后将应用程序复制到硬盘驱动器中的另一个位置并重新开始(git init 等等...)