git pull: keeps telling me to stash local changes before pulling

后端 未结 2 734
情歌与酒
情歌与酒 2021-02-03 12:27

When I am trying to pull my git repository with \"git pull\", it keeps telling me that I have local changes although I have not touched any of the mentioned files. Can someone e

2条回答
  •  广开言路
    2021-02-03 13:11

    Git simply can't pull the changes if the files you have edited locally were changed on the remote. Basically, you have two choices:

    • stage and commit your changes, then Git will try to merge it during the pull (or ask for your help);
    • stash the changes, which puts them aside so you could pull the remote code and then re-apply your modifications.

提交回复
热议问题