Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.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
I';我使用ij idea。我能做些什么来避免git pull操作失败?_Git_Intellij Idea_Git Pull - Fatal编程技术网

I';我使用ij idea。我能做些什么来避免git pull操作失败?

I';我使用ij idea。我能做些什么来避免git pull操作失败?,git,intellij-idea,git-pull,Git,Intellij Idea,Git Pull,它显示的信息类似于 your local files will be override....... gitignore文件是否有问题? 我能做些什么来彻底消除它?非常感谢 这与.gitignore无关,这意味着当其他人在远程存储库中修改同一文件时,您有未提交的更改 提交更改,然后执行拉取 # add your files to the staging area git add . (or any other file that you need) git commit # now pul

它显示的信息类似于

your local files will be override.......
gitignore文件是否有问题?

我能做些什么来彻底消除它?非常感谢

这与
.gitignore
无关,这意味着当其他人在远程存储库中修改同一文件时,您有未提交的更改

提交更改,然后执行拉取

# add your files to the staging area
git add . (or any other file that you need)

git commit

# now pull
git pull
或者,如果您不想承诺:

git stash 

# now pull
git pull


我没有提交.idea目录中的文件,因为我想将其推送到远程分支,而这些文件被禁止推送到远程分支

  • 如果没有将它们添加到gitignore中,请将它们添加到gitignore中
  • 如果它们已经提交,请从索引中删除它们

    # remve the commited files
    git rm --cached <file list>
    
    #删除提交的文件
    git-rm——缓存
    
或者,如果您希望从历史记录中完全删除它们,请使用

BFG-

从现在起使用此忽略文件:



您在拉取之前提交了本地更改吗?提交、隐藏或还原您在本地所做的更改。我没有提交.idea目录中的文件,因为我想将其推送到远程分支,并且这些文件被禁止推送到远程分支。然后使用
.gitignore
忽略.idea文件夹的未来跟踪,并使用
git filter branch
删除.idea文件夹的历史记录。当然,如果它对您有帮助,您应该接受答案。赞赏