git pull总是显示此消息

时间:2020-08-10 05:10:57

标签: git

我进行了git pull操作,并收到此消息:对以下文件的本地更改将被merge覆盖:

   1. etomsef/ui/portal/build/webpack.config.js  
   2.  etomsef/ui/portal/schema/msgs.properties
   3. etomsef/ui/portal/schema/schema.js

Please commit your changes or stash them before you merge.

我是第一次使用git,我感到非常困惑,除了编码部分,它的git需要时间,而且我的文件夹经常损坏,因此我不得不再次克隆所有内容。

上面是我每天收到的MSG,然后使用不同的文件,应该执行什么命令以避免混乱和返工。 我本来可以备份并执行git pull来反转此文件的更改,然后再次粘贴我的更改是唯一的选择

1 个答案:

答案 0 :(得分:1)

在进行如下所示的拉动之前,请先进行提交/存储,然后从您的pullorigin分支中获取一个upstream

git add .
git commit -m "commit message"
git pull origin/upstream branch_name

git stash push -m "message"
git pull origin/upstream branch_name
git stash pop