git 使用是出现该问题时
引用于 git创建分支错误提示 fatal: Not a valid object name: 'master'._ionluo的博客-优快云博客
估计已经是git init(初始化后了)
如果没有就先执行以下几步
1.初始化
git init
2. 创建用户名和邮箱
git config user.name xxx
git config user.email xxx
3. 连接远程仓库(不确定是否需要)
git remote add origin xxx(https://gitee.com/aaa/bbb)
如果有的话,直接先执行本地上传代码前的缓存(初学者,若说错请提醒下,谢谢)
1. git add .
2. git commit -m '注释/备注'
-------------------------------
下面即可以正常创建
3. git branch xxx
切换分支
4. git checkout xxx