簡體   English   中英

Git-有什么方法可以從本地倉庫創建全新的遠程倉庫嗎?

[英]Git - Is there any way to create a brand new remote repo from a local repo?

我想在本地倉庫中用git創建一個全新的,當前不存在的遠程倉庫。

我已經在這里查看了許多答案,幾乎所有答案都與以下內容類似:

mkdir test2
cd test2
git init
cat > somefile
git add *
git commit -m 'd'
git remote add origin git@git.myserver.com:myorg/myrepo
# also tried git remote add origin git@git.myserver.com:myorg/myrepo.git
git push origin master

但是,我得到的響應始終是:

ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我是該組織的所有者/管理員,應該對此擁有所有權限。 repo myrepo不存在,我正在嘗試從遠程計算機創建它。 無論如何,這是服務器端選項還是類似的東西? 我沒有訪問git服務器在那里進行修改的權限,並且真的希望不必使用http界面進行全部修改。

最簡潔的答案是不。 這樣想:Git無法知道您指定為遠程URL另一端的內容。 它不知道您在那里是否具有權限,或者根本不存在Git安裝。 創建遠程存儲庫的唯一方法是轉到遠程位置並創建一個遠程存儲庫,例如,通過登錄GitHub或登錄git.myserver.com並在此處創建存儲庫。 希望能有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM