Cannot update paths and switch to branch at the same time

[已解决]fatal: Cannot update paths and switch to branch 'master' at the same time.

Did you intend to checkout 'origin/master' which can not be resolved as commit?

本地创建的git仓库,首次提交时出现此问题,先执行:

git fetch
git pull origin master

再执行

git push

clone一个git仓库,首次push一般有如下步骤:

Step 1: 切到本地仓库上

cd /path/to/your/repo

Step 2: 连接到远程仓库

git remote add origin git@bitbucket.org:yonghuixie/r.git

git push -u origin master

git