在往github上push代碼時,步驟:
(1) git init
(2) git add .
(3) git commit -m “first commit” (“git commit -m “提交信息””)
(4) git remote add origin https://github.com/2281123066/doc2vec.git
(5) git push -u origin master
在第(5)步時出錯:
出現錯誤的主要原因是github中的README.md文件不在本地代碼目錄中。
可以通過如下命令進行代碼合併【注:pull=fetch+merge】
git pull --rebase origin master
執行上面代碼後可以看到本地代碼庫中多了README.md文件,
此時再執行語句 git push -u origin master即可完成代碼上傳到github。