【Git切换分支出现错误:Your local changes to the following files would be overwritten by checkout】

  • 出现错误

用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'

截图入下:
【Git切换分支出现错误:Your local changes to the following files would be overwritten by checkout】_第1张图片

  • 新的问题:

Please tell me who you are
  • 解决办法:

参考文献

# 在命令行中执行以下操作即可:
git config --global user.email "你的邮箱"
git config --global user.name "你的名字"

截图如下:
【Git切换分支出现错误:Your local changes to the following files would be overwritten by checkout】_第2张图片
切换分支成功!

你可能感兴趣的:(pytorch,深度学习,人工智能)