Wednesday 15 May 2019

Resolved | GIT branch switch issue

While using GIT, encountered a special scenario. I was working on one branch. There were no changes local. Then I decided to switch to different branch.

I have faced below error.
===========================================================================
$ git checkout New_Temp_Branch
error : The following untracked working tree files would be overwritten by checkout:
      <list of files here>
Please move or remove them before you can switch branches.
Aborting
===========================================================================

Solution : Use below set of commands.

git add *
git stash
git pull

This will track all files, remove all of your local changes to those files, and then get the files from the server.

No comments:

Post a Comment