出现这个错误查了下,是要先commit一次后才能正常分支。
步骤:
1.先创建代码仓库
打开git Bash,切换到你要创建仓库的目录之下,然后输入命令
$ git init
2.提交姓名和邮箱
3.commit一次
先添加,再提交
$ git add myfile.txt
$ git commit -m "first commit"
4.建立分支
git branch issue1
只输入git branch 可以看分支列表
5.切换分支
切换到issue1分支。
$ git checkout issue1
注:可参考地址为
https://backlog.com/git-tutorial/cn/stepup/stepup2_3.html
https://ruby-china.org/topics/2424
http://www.bootcss.com/p/git-guide/