2017-11-11 213 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

谢谢!它正在工作! –

相关问题