- 在你的項(xiàng)目根目錄下打開git
2.git init
3.git add .
//添加上傳的文件(所有的)
4.git commit -m "描述(比如:第一次像遠(yuǎn)程倉庫提交我的代碼)"
//提交上傳的文件
5.git remote add origin 你的倉庫地址
6.git remote set-url origin https://<你的token>@github.com/<你的名字>/<項(xiàng)目名>.git
//與遠(yuǎn)程的倉庫建立連接
7.git push -u origin master
//把提交在本地倉庫的文件上傳到遠(yuǎn)程git倉庫
8.如果提示:
error: failed to push some refs to 'https://github.com/zgscmt/uni-test.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
git pull --rebase origin master
9.git push -u origin master