忽略文件中的更改,但不要将它们从远程代表中删除 [英] ignore my changes in files but don't delete them from remote rep
问题描述
我的工作目录中有几个文件存在于远程代表中,我经常为了某些原因而更改它们。
是否有可能让git忽略这些文件在提交时,同时这些文件不应该从远程代理删除。
当我从远程代理中提取更改时,不应合并这些文件。
是否可以这样做?
PS git update-index --assume-unchanged
没有帮助 git pull
会尝试合并文件因为 - 承担 - 不变
不起作用,您可以尝试使用
git update-index
): git update-index --skip-worktree - afile
(如 Git - 区别' code> assume-unchanged '和' skip-worktree
')
I have several files in my working directory which exist in remote rep and I always change them for specific reason.
Is it possible to make git to ignore those files while commiting, and same time those files should not be deleted from remote rep
And when I pull changes from remote rep those files should not be merged
Is it possible to do this?
P.S. git update-index --assume-unchanged
doesn't help as git pull
will try to merge files anyway
Since --assume-unchanged
doesn't work, you can try (git update-index
):
git update-index --skip-worktree -- afile
(as mentioned in "Git - Difference Between 'assume-unchanged
' and 'skip-worktree
'")
这篇关于忽略文件中的更改,但不要将它们从远程代表中删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!