在github建立一個repositorygit
執行命令github
git init git add . git commit -m"" git remote add origin https://github.com/9xxxxxxx/xxx.git git push -u origin master
此時可能出現以下問題code
這時須要pullblog
git pull origin master
此時會出現以下問題開發
這時會發現 github 的倉庫和本地的沒有一個共同的 commit 因此 git 不讓提交,認爲是寫錯了 origin
,若是開發者肯定是這個 origin
就能夠使用 --allow-unrelated-histories
告訴 git 本身肯定rem
git pull origin master --allow-unrelated-histories
解決衝突正常提交便可,首次提交git push origin masterit