2017-11-11 89 views
1

這裏是我做的,到目前爲止(在SourceTree):
如何使用SourceTree創建新的git存儲庫?

  1. 選擇「新建庫」
  2. 選擇目標路徑(「你好」)
  3. 在「喂」創建一個文件目錄
  4. 提交該文件(它創建一個本地主分支)
  5. 創建新的遠程(SSH://[email protected]:22/SRV/GIT中/喂)
  6. 推到遠程分支

現在,我得到一個錯誤:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream origin master:master

Pushing to ssh://[email protected]:22/srv/git/hallo

fatal: '/srv/git/hallo' does not appear to be a git repository
fatal: Could not read from remote repository.

我與其他存放區的十幾個工作,而不該服務器上的任何困難。所以它不能成爲訪問或ssh問題。我也加倍檢查了服務器的IP地址。

如果我啓動終端並寫上 「混帳遠程-v」 我得到:

origin ssh://[email protected]:22/srv/git/hallo (fetch)
origin ssh://[email protected]:22/srv/git/hallo (push)

如果我試圖把( 「混帳推起源大師」)我得到:

fatal: '/srv/git/hallo' does not appear to be a git repository
fatal: Could not read from remote repository.

請確保您擁有正確的訪問權限 並存在存儲庫。

我不知道我錯過了什麼。 你能幫忙嗎?

+0

你創建一個SSH服務器上的一個新的回購? – VonC

+0

嘗試將git文件夾更改爲另一個文件夾,您的錯誤可能是由寫入權限引起的。 –

+0

@VonC:不,我沒有。我一定要嗎?我認爲推動提交會爲我做到這一點。這是錯的嗎? –

回答

1

No, I didn't. Do I have to? I thought pushing a commit will do this for me.

是的,您應該先創建一個遠程回購。

連接到SSH://[email protected]:22,並創建一個裸回購:

cd /srv/git/ 
git init --bare hallo 
+0

謝謝!它正在工作! –