Git报错: Please move or remove them before you switch branches.

Bug record: When I was writing the requirements, the product said that the last package crashed, so I cut the branch with the console git checkout, and the result was an error Please move or remove them before you switch branches. The following is the changed file, because it is a project Temporary files generated during build are generally not uploaded, so I want to delete them.

1. First:

git status

Look at the status of the current branch to know what has changed.

2. Check which ones are to be deleted

git clean -n


3. If you want to completely delete local modifications , usegit clean -dfx。

git clean -dfx

Tips: This operation will completely delete the local modification, and your code will be consistent with the remote code.

 

 

Guess you like

Origin blog.csdn.net/LoveFHM/article/details/131292566