2010-06-24 106 views
0

如何删除远程存储库中的文件?从存储库和文件系统删除GIT中的文件

git rm my_path/my_file 

强制删除文件

git rm --force my_path/my_file 

删除文件

+1

你想从项目中删除文件以后还是你想从以前提交删除文件,因为它们包含密码或一些类似的原因是什么? – 2010-06-24 09:53:03

+0

git rm路径然后commit-push不起作用? – pakore 2010-06-24 09:54:28

回答

2

删除文件只从你的资料库不是在你的文件系统

git rm --cached my_path/my_file 
+0

有没有在Git GUI中做到这一点? – 2010-06-24 10:44:18

+0

我不使用一些gui – shingara 2010-06-24 12:04:57