解决被我们删除,保留本地文件
resolve deleted by us and keep the local files
我最近向 gitignore 添加了一些 .txt 文件,但在我将 gitignore 推送到远程之前,有人向远程推送了一个新提交。现在,当我将它拉到我的语言环境分支时,我得到了未合并的路径,这些路径为那些 .txt 文件说 "deleted by us" 。我怎样才能解决合并问题,以便我可以保留我的语言环境 .txt 文件并告诉远程删除 .txt 文件?
只需对每个要从修订控制中删除的文件调用 git checkout --ours [path]
+ git rm --cached [path]
,然后将其保存在本地,然后将其推送到远程。
--cached
Use this option to unstage and remove paths only from the index. Working tree files, whether modified or not, will be left alone.
我最近向 gitignore 添加了一些 .txt 文件,但在我将 gitignore 推送到远程之前,有人向远程推送了一个新提交。现在,当我将它拉到我的语言环境分支时,我得到了未合并的路径,这些路径为那些 .txt 文件说 "deleted by us" 。我怎样才能解决合并问题,以便我可以保留我的语言环境 .txt 文件并告诉远程删除 .txt 文件?
只需对每个要从修订控制中删除的文件调用 git checkout --ours [path]
+ git rm --cached [path]
,然后将其保存在本地,然后将其推送到远程。
--cached
Use this option to unstage and remove paths only from the index. Working tree files, whether modified or not, will be left alone.