第一步:在github上面創建一個repository
點擊create就好了。然后會出現下面的頁面。
第三步:打開你所在文件夾,或者是新建的文件夾(用來做倉庫的)右鍵會出現下面 選用git Bash Here 命令行執行。
點擊以后出現下面圖片
然后就是使用剛才我們在github上面創建的倉庫 依次執行下面的代碼。。。下面是兩種形式。(空倉庫、項目所在倉庫)
create a new repository on the command line
echo "# project" >> README.md git init git add README.md git commit -m "first commit" git remote add origin 這里是自己的鏈接 git push -u origin master
push an existing repository from the command line
git remote add origin 自己創建的repository鏈接 git push -u origin master
本人用的是第二種比較方便:
遇到問題分享一下:
remote origin already exists.
解決方法:
先刪除遠程Git倉庫用 $ git remote rm origin