忽略GIT拉过程中的conf文件

问题描述 投票:2回答:1

我有以下的混帐文件:

-com.src.java.blabla
-config
  conf.yaml

我想更新项目的所有代码拉请求,但不conf.yaml,因为它已被修改为包含路径到本地机器。 因此,我拉被拒绝:

error: Your local changes to the following files would be overwritten by merge:
        conf.yaml
Please commit your changes or stash them before you merge.
Aborting
git
1个回答
3
投票

你可以拉前藏匿你的本地修改:

$ git stash

现在你的工作区域是干净的,你可以做git pull。然后,做一个git stash pop到本地修改合并到工作区:

$ git stash pop

这具有正确也考虑了你在本地修改的文件上游修改和合并本地更改回来的优势。

© www.soinside.com 2019 - 2024. All rights reserved.