相关疑难解决方法(0)

来自远程ssh存储库的Git克隆 - 在执行clone命令之前更改远程网络上的计算机

我想从我公司的服务器克隆一个git存储库到我的个人电脑.从"外部"访问这些服务器的唯一方法是将每个ssh登录到"machine1"

ssh user@machine1.company.xy
Run Code Online (Sandbox Code Playgroud)

不幸的是,git没有安装在那台特定的机器上.所以git克隆就像

git clone ssh://user@machine1.company.xy/path/to/repo <local-repo-path>
Run Code Online (Sandbox Code Playgroud)

不行.我需要做的是在通过'machine1'登录网络后更改到安装了git的另一台机器'machine2'.因此,要使克隆工作,我将不得不执行一个命令

ssh machine2
Run Code Online (Sandbox Code Playgroud)

在实际执行git命令之前.有没有办法做到这一点?像预克隆钩子之类的东西可能吗?

有可能以某种方式将远程存储库打包到一个文件(补丁?),将该文件复制到本地计算机并从该文件克隆?

期待您的提示和建议!

git ssh proxy git-clone

7
推荐指数
1
解决办法
2万
查看次数

从一个gitosis pip安装

我有工作的gitosis repo.如果我做

git clone git@server:repo.git
Run Code Online (Sandbox Code Playgroud)

它正确地克隆了回购.但是,如果我这样做,它就不起作用:

git clone ssh://git@server:repo.git

Cloning into repo...
ssh: connect to host  port 22: Connection refused
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

问题是,当我使用pipII时:

pip install git+ssh://git@server:repo.git
Run Code Online (Sandbox Code Playgroud)

当然还有:

Cloning into repo...
ssh: connect to host  port 22: Connection refused
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

如果我想这样做:

pip install git+git@server:repo.git 
Run Code Online (Sandbox Code Playgroud)

我明白了

ValueError: ('Expected version spec in', 'git+git@server:repo.git', 'at', '+git@server:repo.git')
Run Code Online (Sandbox Code Playgroud)

有没有办法配置pip或gitosis所以我可以让它工作?

谢谢,

(请避免'使用gitolite',如果可以,我会的话)

git ssh pip gitosis

7
推荐指数
1
解决办法
3572
查看次数

当我推送到有效的SSH地址时,为什么git无法解析主机名?

我正在Heroku上部署一个应用程序,所以我从一个repo创建了一个Heroku应用程序然后做了git push heroku master.当我这样做时,它一直给我错误:

!  Your key with fingerprint xxx is not authorized to access heroku-app.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

我尝试了各种更改SSH密钥的方法,包括删除所有密钥并创建新密钥.它仍然给我同样的错误.我已将密钥添加到Heroku.

然后我尝试运行ssh -vT git@heroku.com:heroku-app.git,结果是:

OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 53: Applying options for *
ssh: Could not resolve hostname heroku.com:heroku-app.git: nodename nor servname …
Run Code Online (Sandbox Code Playgroud)

git ssh heroku ssh-keys git-remote

6
推荐指数
1
解决办法
6696
查看次数

标签 统计

git ×3

ssh ×3

git-clone ×1

git-remote ×1

gitosis ×1

heroku ×1

pip ×1

proxy ×1

ssh-keys ×1