1. 程式人生 > >idea為本地項目創建倉庫並git到雲上

idea為本地項目創建倉庫並git到雲上

code allow baidu 關聯 nbsp people 分享圖片 tail itl

1、為本地項目創建一個本地倉庫:

技術分享圖片

2、在碼雲上創建一個倉庫,(初始化的時候先不要創建README.md文件)

3、本地倉庫關聯遠程倉庫:右鍵項目選址git>>repository>>remotes

技術分享圖片

點+號輸入遠程倉庫的地址

技術分享圖片

4、add、commit、pull、push將本地項目存儲到遠程倉庫

如果報錯:refusing to merge unrelated histories

則:git pull origin master --allow-unrelated-histories

如果>>git push 提示fatal: The current branch master has no upstream branch.


To push the current branch and set the remote as upstream, use

則執行:git push --set-upstream origin master

或者:git push -u origin master (說是如果沒有分支會創建分支,未驗證)

技術分享圖片

idea創建git項目到遠程倉庫:https://jingyan.baidu.com/article/0a52e3f4ef625bbf62ed7286.html

IDEA中如何初始化git本地倉庫,並提交到遠程倉庫

idea為本地項目創建倉庫並git到雲上