进行初始化git的时候:
git init
git add .
git branch -M master
git remote add origin git@github.com:xxx/xxxx.git
git push origin master
到了git branch -M master这一步,报错:
>git branch -M master
error: refname refs/heads/master not found
fatal: Branch rename failed
找了一大圈原因,结果大跌眼镜:
没有commit 成功!
# 找了一下历史操作,没有add!!!!
>git init
Initialized empty Git repository in ./.git/
>git commit -m "pyramids first commit!"
On branch master
Initial commit
Untracked files:
README.md
lena_gray.png
pyramids_test.ipynb
nothing added to commit but untracked files present
#查看了一下status
>git status
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
README.md
lena_gray.png
pyramids_test.ipynb
nothing added to commit but untracked files present (use "git add" to track)
参考文章:src refspec master does not match any when pushing commits in git - git