忽略文件中的更改,但不要将它们从远程代表中删除 [英] ignore my changes in files but don't delete them from remote rep

查看:95
本文介绍了忽略文件中的更改,但不要将它们从远程代表中删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作目录中有几个文件存在于远程代表中,我经常为了某些原因而更改它们。



是否有可能让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屋!

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