吉特'~/回购git/';不是git命令

吉特'~/回购git/';不是git命令,git,smartgit,Git,Smartgit,我对远程git回购和本地回购(使用SmartGit)有问题 我正在通过ssh在服务器上创建远程回购: > cd ~ > git init repo.git > cd repo.git > touch readme > git add . > git commit -m "Initial commit" 从这里看来,一切都很完美。现在我正尝试使用Smartgit with命令克隆repo ssh://user@server:22/~/repo.git 一切都

我对远程git回购和本地回购(使用SmartGit)有问题

我正在通过ssh在服务器上创建远程回购:

> cd ~
> git init repo.git
> cd repo.git
> touch readme
> git add .
> git commit -m "Initial commit"
从这里看来,一切都很完美。现在我正尝试使用Smartgit with命令克隆repo

ssh://user@server:22/~/repo.git
一切都很好。我在自述文件中进行更改,保存该文件并尝试提交和推送,但出现错误:

The remote end hang up unexpectedly
git: '~/repo.git' is not a git command. See 'git --help'
我做错了什么?
谢谢。

您不需要指定端口22;这是SSH的默认端口。另外,如果指定
user@server:路径

试着用…来克隆

user@server:~/repo.git

相反。

您不需要指定端口22;这是SSH的默认端口。另外,如果指定
user@server:路径

试着用…来克隆

user@server:~/repo.git
取而代之。

使用:

GIT_TRACE=2 git push origin master
并查看调试问题时发生的情况

更新:

它正在尝试git接收包

尝试执行以下操作:

git config --global remote.origin.receivepack "git receive-pack"
然后再推一次

其他你可以尝试的事情:

在远程服务器上设置一个裸repo:

git init --bare
然后尝试克隆并推送到它。

使用:

GIT_TRACE=2 git push origin master
并查看调试问题时发生的情况

更新:

它正在尝试git接收包

尝试执行以下操作:

git config --global remote.origin.receivepack "git receive-pack"
然后再推一次

其他你可以尝试的事情:

在远程服务器上设置一个裸repo:

git init --bare

然后尝试克隆并推到它。

我建议使用完整路径而不是主快捷方式(~),例如,
git clonessh://user@服务器/主页/tuergeist/repo

这对我来说适用于linux,也适用于git bash中的WindowsXP


您还应该禁用
.git
扩展,这可能会混淆您的工具,因为它需要一个简单的存储库。(但我不确定)

我建议使用完整路径而不是主快捷方式(~),例如,
git clonessh://user@服务器/主页/tuergeist/repo

这对我来说适用于linux,也适用于git bash中的WindowsXP


您还应该禁用
.git
扩展,这可能会混淆您的工具,因为它需要一个简单的存储库。(但我不确定)

在SmartGit?@bender.rodriges-更新我的答案的哪里可以这样做?在SmartGit?@bender.rodriges-更新我的答案的哪里可以这样做。