gitversion-control

What does "commit your changes or stash them" mean?


I have my branch on my GIT repository where I used to commit and push. But today I saw a different programmer committed and pushed to my branch. Now when I try to pull the latest branch GIT completes it half way and then gives error "Either commit your changes or stash them". I have no idea what that means and I don't want to commit before taking his latest changes on my branch. How do I solve this issue?


Solution

  • It means that you have uncommitted changes, which prevents you from pulling.

    And you solve it by either committing them or stashing them. Just like the error message says.

    (By the way, you typically get better answers by asking precise questions. If you want to know what git stash is, ask that. Simply asking "how do I solve the problem where Git tells me to commit or stash" simply leads to answers like "you should commit or stash".

    Git itself has already answered your question. If you didn't understand that answer, ask about the part you don't understand.