git 异常汇总

fatal: This operation must be run in a work tree

解决方法:在该仓库目录下,新建文件夹,进入该文件夹,执行如下命令:

1. touch Readme
2. git init
3. git add Readme
4. git commit -m 'initial commit' Readme

git 错误 fatal: This operation must be run in a work tree

git 当前不在任何分支上

解决方案:git checkout master

git pull提示当前不在某个分支上