Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.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拉取自动覆盖文件?_Git - Fatal编程技术网

使用git拉取自动覆盖文件?

使用git拉取自动覆盖文件?,git,Git,我运行以下命令: git pull https://bitbucket.org/NAME 然后会弹出一个错误: From https://bitbucket.org/NAME/project-tool * branch HEAD -> FETCH_HEAD Auto-merging includes/top.php CONFLICT (add/add): Merge conflict in includes/top.php 然后它有: (Branch

我运行以下命令:

git pull https://bitbucket.org/NAME
然后会弹出一个错误:

From https://bitbucket.org/NAME/project-tool
 * branch            HEAD       -> FETCH_HEAD
Auto-merging includes/top.php
CONFLICT (add/add): Merge conflict in includes/top.php
然后它有:

(Branch|MERGING)
我可以用这个覆盖它,但我只想拉这个存储库,不在乎它是否覆盖了每个文件(我已经备份)


如何使用git拉入文件并自动合并和覆盖当前文件?

这将从远程获取文件并将其存储在本地存储库中

git fetch https://bitbucket.org/NAME
如果要将本地分支设置为与远程分支匹配,从而删除本地分支更改,请使用以下命令。确保备份了本地文件

git reset --merge
git reset --hard FETCH_HEAD