GIT - '〜/ repo.git /'不是git命令 [英] GIT - '~/repo.git/' is not a git command
问题描述
我在使用远程git repo和本地回购(使用SmartGit)时遇到了问题。
我通过ssh在服务器上创建远程回购:
> cd〜
> git init repo.git
> cd repo.git
> touch readme
> git add。
> git commit -m初始提交
从这里一切似乎都很完美。现在我试图通过命令来使用Smartgit来克隆repo
$ b $ $ p $ s $ c $ ssh:// user @ server:22 /〜/ repo。 git
一切都很好。我在自述文件中进行了更改,保存并尝试提交并推送并获取错误:
远程端意外挂断
git:'〜/ repo.git'不是git命令。见'git --help'
我做错了什么?
谢谢。
使用:
GIT_TRACE = 2 git push origin master
并查看发生了什么调试问题。
更新:
它正在尝试 git-receive-pack
请尝试以下操作:
git config --global remote.origin.receivepackgit receive-pack
然后按下
您可以尝试的其他操作:
在远程服务器上设置裸露的repo:
git init --bare
然后尝试克隆并推送到它。
I have a problem with with remote git repo and local repo (using SmartGit).
I'm creating remote repo on my server via ssh:
> cd ~
> git init repo.git
> cd repo.git
> touch readme
> git add .
> git commit -m "Initial commit"
From here everything seems perfect. Now I'm trying to clone repo using Smartgit with command
ssh://user@server:22/~/repo.git
Everything is cloning well. I make changes in readme file, saving it and trying to commit and push and getting error:
The remote end hang up unexpectedly
git: '~/repo.git' is not a git command. See 'git --help'
What am I doing wrong? Thank you.
Use:
GIT_TRACE=2 git push origin master
and see what is happening to debug the issue.
Update:
It is trying git-receive-pack
Try doing below:
git config --global remote.origin.receivepack "git receive-pack"
And then do the push again.
Other things you can try:
On the remote server setup a bare repo:
git init --bare
And then try cloning and pushing to it.
这篇关于GIT - '〜/ repo.git /'不是git命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!