1、在github上創建版本庫cpptest
2、在ubuntu上代碼路徑/home/mnt/c/cpptest/目錄下執行git init
3、git add *
4、git commit -m “cpp file test”
5、git remote add origin [email protected]:greatitman/cpptest.git
6、git push -u origin master,此步若出現類似“non-fast-forward errors”的錯誤,則執行7
7、git pull,此步若出現“branch.master.merge”類似錯誤,則執行8
8、修改配置文件.git/config或執行如下命令
git config branch.master.remote origin
git config branch.master.merge refs/heads/master