如何重新初始化git仓库? [英] How can I re-init my git repo?

查看:127
本文介绍了如何重新初始化git仓库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在做一些回购交易,不需要历史记录.

I've been doing some beginning work on a repo and I don't need the history.

我想从零开始没有历史吗?

I want to start from ground zero w/ no history?

我可以简单地删除 .git 文件夹并再次运行 git init .

Can I simply delete the .git folder and run git init again.

但是这将如何影响我的远程存储库?

But how will this effect my remote repos?

推荐答案

cd "$PWD/`git rev-parse --show-cdup`" #go to the project's root
rm -rf .git

然后:

git init .
#...

对于您的远程存储库,您需要 git push --force 放入其中(或推送到一个完全独立的新分支).

As for your remote repos, you'll need to git push --force into them (or push to a new, completely separate branch).

这篇关于如何重新初始化git仓库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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