First of all, you can use git fetch at any time to download changes from a remote repository without affecting your working directory or your local branches at all.
What you probably want is to save your changes in order to update the local branch to the latest state, and then continue to work on your changes. To do this, use git stash . This will temporarily save your changes and then revert them, so it looks like you didn’t do anything (don’t worry, it is still saved). Then you can just git pull update the branch and get the latest changes. After that, use git stash pop to unlock your changes and revert them.
In some cases, you will encounter conflicts during unstable operation, usually when starting editing files that have also been changed in updates from git pull . These files get regular conflict markers, and you can resolve them locally just like you used to.
source share