问题描述
我尝试了以下和,但我仍然有问题。
我的本地环境是windows和我的远程linux。我有几个问题:
- 在第一篇文章中,它描述了为服务器设置公共ssh密钥 - 我从来没有做过这之前,我不知道在哪里键入命令(甚至不知道是否本地或远程!!):
ssh myuser@server.com mkdir .ssh
和scp〜/ .ssh / id_rsa.pub myuser@server.com:.ssh / authorized_keys
- 在我的本地开发机器上运行?有没有替代品,因为我安装的版本占用了1.4 GB!我从
我试过跳过git用户和公共密钥,在远程机器上创建存储库,但当我尝试 git remote add origin ssh:// [username] @ [domain / ip / hostname] / srv / git / [project -name]
作为root用户它说: fatal:不是git存储库(或任何父目录):.git
- 我一直在尝试使用putty生成密钥对,但无法使其正常工作。最后我意识到我可以使用
ssh-keygen -Cgit@example.com-t rsa
通过msysgit命令行生成密钥。使用nano /home/git/.ssh/authorized_keys
和hey presto将公钥复制到服务器中! - 我已经下载了完整的源代码,因此大小!非源代码应用
Git-1.7.4-preview20110204.exe
仅为13MB,通过 - In the first article it describes setting up a public ssh key for the server - I've never done this before and I'm not sure where to type the commands (not even sure whether local or remote!!):
ssh myuser@server.com mkdir .ssh
andscp ~/.ssh/id_rsa.pub myuser@server.com:.ssh/authorized_keys
- On my local dev machine should I be running msysgit? Is there an alternative because the version I installed is taking up 1.4 GB! I installed
msysGit-netinstall-1.7.4-preview20110204.exe
from http://code.google.com/p/msysgit/downloads/list - I had been trying to generate the key pairs using putty but couldn't get it to work. In the end I realised that I could generate the keys via the msysgit command line using
ssh-keygen -C "git@example.com" -t rsa
. Copy the public key to the server usingnano /home/git/.ssh/authorized_keys
and hey presto! - I had downloaded the full source code hence the size! The non-source app,
Git-1.7.4-preview20110204.exe
was just 13MB via http://code.google.com/p/msysgit/downloads/list?can=3
ol>
I have tried following how-set-up-your-own-private-git-server-linux and private-remote-git-repositories-ubuntu-linode but I am still having problems.
My local environment is windows and my remote linux. I have a couple of questions:
I tried skipping making the git user and public key, created the repositories on the remote machine but then when I try git remote add origin ssh://[username]@[domain/ip/hostname]/srv/git/[project-name]
as root user it says: fatal: Not a git repository (or any of the parent directories): .git
这篇关于如何在Linux上设置私人git服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!