首页 > 解决方案 > 由于 .gitignore 未跟踪,无法 git pull

问题描述

执行后: git pull origin master

我得到以下信息:

* branch            master     -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
.gitignore
Please move or remove them before you merge.

Aborting

我该如何继续?

标签: gitgitignorepull

解决方案


输出告诉您有未提交的更改。

您可以执行以下操作之一:

对于add & commit您的更改:

# Add and commit changes
git add . && git commit -m"Message"

要放弃更改:

# discard your changes
git checkout -- .gitignore

推荐阅读