我創建了一個新的版本庫:混帳 - 遠程添加原產VS遠程設置網址起源
git init
echo "# MESSAGE" >> README.md
git add README.md
git commit -m "first commit"
然後我想我推承諾在GitHub上創建的,所以我必須設置遠程空遠程倉庫。
使用以下命令有什麼區別? :
git remote add origin [email protected]:User/UserRepo.git
git remote set-url origin [email protected]:User/UserRepo.git
最後我執行推:
git push -u origin master
EDIT1:
當我打電話遠程設置網址起源只是git的初始化後,會發生什麼?遠程設置網址原點是否創建原點?如果在git init之後源已經存在,那麼在我的場景中使用這些命令沒有區別,對吧?
如果我從A克隆到我的本地,然後使用「git remote set-url B」。它會刪除A中的存儲庫嗎?我正在嘗試從AWS代碼克隆存儲庫到GitLab – Josh