用git将代码切换分支时,出现以下错误
Your local changes to the following files would be overwritten by checkout:
file1
file2
Please commit your changes or stash them before you switch branches.
Aborting
git add file1
git add file2
git commit -m 'commit message'
截图入下:
Please tell me who you are
# 在命令行中执行以下操作即可:
git config --global user.email "你的邮箱"
git config --global user.name "你的名字"
截图如下:
切换分支成功!