背景:从 2020 年 10 月 1 日起,在 Github 平台上创建的所有新的源代码仓库将默认命名为 "main" ,不再是原先的 "master" 。 原因是“master”容易引起歧义,所以普遍使用中性词“main”
但此次修改并不会影响先前的存储库
今天打算往git仓库提交代码,按惯例复制三行代码
但运行到第二行的时候报错 如下:
error: refname refs/heads/master not found
fatal: Branch rename failed
错误原因是没有commit代码,commit代码后便可提交。
git init
git add .
git comit -v