昨天在做一个练习。练习题目为:
新建本地分支,分支名用自己的昵称。
遇到了不少问题,现在已经解决了。现在来总结一下本地新建分支的踩坑指南。
遇到的问题,及对应解决方法:
1.fatal: Not a git repository (or any of the parent directories): .git
解决办法:
输入命令: Git init--初始化仓库

2.fatal: Not a valid object name: 'master'
解决办法:
输入命令:
1).用Git status 查看状态
2)设置邮箱:git config --global user.email "you@example.com"
3)设置用户名:git config --global user.name "Your Name"
4)将所有修改添加到暂存区:git add Practitioner(自己的仓库名)
5)将修改后的文件提交:git commit -m "idoxu21day"
6)新建本地分支:git branch idoxu21day
7)查看新建分支是否成功:git branch

继续学习,继续踩坑,该午休啦~
网友评论