Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git pull即使在取消跟踪文件后也不工作?_Git_Github_Gitignore_Git Pull - Fatal编程技术网

Git pull即使在取消跟踪文件后也不工作?

Git pull即使在取消跟踪文件后也不工作?,git,github,gitignore,git-pull,Git,Github,Gitignore,Git Pull,我的网站使用开源论坛应用程序,源代码托管在Github上,我必须使用git pull更新它 问题是我对跟踪文件做了一些更改,所以Git不再允许我成功地执行Git拉取操作。下面是我为解决这个问题所做的: 已将文件添加到.gitignore 运行命令git update index--succession unchanged file.rb,以确保文件未被跟踪 但我仍然无法执行git拉取,可能是因为这个原因——即使文件在本地未被跟踪,它仍然由远程存储库跟踪。在这种情况下,在确保忽略file.rb

我的网站使用开源论坛应用程序,源代码托管在Github上,我必须使用
git pull
更新它

问题是我对跟踪文件做了一些更改,所以Git不再允许我成功地执行
Git拉取操作。下面是我为解决这个问题所做的:

  • 已将文件添加到.gitignore
  • 运行命令
    git update index--succession unchanged file.rb
    ,以确保文件未被跟踪
但我仍然无法执行
git拉取
,可能是因为这个原因——即使文件在本地未被跟踪,它仍然由远程存储库跟踪。在这种情况下,在确保忽略
file.rb
的同时,如何执行
git pull
来更新我的站点


编辑:请注意,我无法对远程回购进行任何更改。任何更改都必须在本地进行。

不要忽略该文件,请尝试提交该文件,然后执行拉取操作。如果文件没有冲突,它将被合并,否则您将能够使用解决本地冲突,例如。

正确,
git commit
不会进行任何远程更改,提交后您将能够拉取和合并远程更改您的意思是,我必须运行这些命令,对吗?1. <代码>git添加。
2
git提交-m“一些更改”
3
git-pull
——这次git-pull通过了,但我希望这是正确的方式。如果我做错了,请告诉我。@bredikhin非常感谢你!