Git Error: save or commit

I am new to Git and I am struggling with a bug.

I have a local copy of the code that is in prod and made some changes (after git pull). Having made local changes, I did:

git add .
git commit -m
git push

Then I went to the prod server and started git pull. I got the following error:

-> origin/master
error: Your local changes to the following files would be overwritten by merge:
Please, commit your changes or stash them before you can merge.
error: The following untracked working tree files would be overwritten by merge:

I am not sure how this will affect my code if I delay the changes or make a commit. What should I do?

+4
source share
1 answer

This error means that you changed your files on the prod server, which will be knocked down by the command git pullyou are trying to run. Git decides that this is probably not what you want to do.

git status, , , / prod, , . :

  • git reset: , , , pull.
  • git commit ( ): , , . .
  • git stash: - , , . .
+5

Source: https://habr.com/ru/post/1615529/


All Articles