如何从git克隆的项目中删除版本跟踪? [英] How do I remove version tracking from a project cloned from git?

查看:441
本文介绍了如何从git克隆的项目中删除版本跟踪?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从项目目录中删除所有版本跟踪.

I want to remove all version tracking from a project's directory.

执行此操作的正确方法是什么?

What is the correct method to do this?

我可以执行以下shell命令吗?

Can I do a shell command such as:

rm -rf .git

从我的项目目录中还是有办法作为Git命令来做到这一点?

from my projects directory or is there a way to do this as a Git command?

我使用这个项目来学习Git,并意识到在项目的早期,我曾因移动,重命名和删除文件而犯了一些错误.我想删除所有Git跟踪,并从git init重新开始.

I used this project to learn Git and realize I made some mistakes early on in the project with moved, renamed and deleted files. I'd like to remove all Git tracking and start fresh with git init.

推荐答案

Git用于信息的所有数据都存储在.git/中,因此删除它应该可以正常工作.当然,请确保您的工作副本处于所需状态,因为其他所有内容都会丢失. .git文件夹是隐藏的,因此请确保打开Show hidden files, folders and disks选项.

All the data Git uses for information is stored in .git/, so removing it should work just fine. Of course, make sure that your working copy is in the exact state that you want it, because everything else will be lost. .git folder is hidden so make sure you turn on the Show hidden files, folders and disks option.

从那里,您可以运行git init创建一个新的存储库.

From there, you can run git init to create a fresh repository.

这篇关于如何从git克隆的项目中删除版本跟踪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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