日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

github上傳代碼error: src refspec master does not match any error: failed to push some refs to ‘https://g

作者:jack@london 更新時間: 2022-04-11 編程語言

github上傳代碼至某空倉repository,有時候遇到報錯。

完整的過程為:

echo "# psaData" >> README.md

git init

git add README.md

git config --global user.email "you@example.com" (可以去掉--global)

git config --global user.name "Your Name"?(可以去掉--global)

git commit -m "first commit for your repo"

git status

git remote add origin https://github.com/{youre_account}/{youre_repo}.git

git push -u origin master

【注意】現在可能已經改為main,而不是master

下一次提交之前,一定要先同步本地與repository代碼。

git pull origin master

如果要提交代碼的repository不是空倉,則首先git clone將其下載下來。

隨后從git add 本地文件 開始,config視情況而定。

git下載代碼后,可以通過git status或git branch查看當前所在分支

可以通過git branch -a查看代碼所有分支

通過git checkout -b other?origin/other切換到其它分支

另外,如需rename repository的名字,可以到repository的Settings?tab中。

原文鏈接:https://blog.csdn.net/figosoar/article/details/108635030

欄目分類
最近更新