如何在Linux上设置私人git服务器 [英] How to set up private git server on linux

查看:136
本文介绍了如何在Linux上设置私人git服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了以下如何设置-your-own-private-git-server-linux 私有远程-git-repositories-ubuntu-linode ,但我仍然有问题。



我的本​​地环境是windows和我的远程linux。我有几个问题:


  1. 在第一篇文章中,它描述了为服务器设置公共ssh密钥 - 我从来没有做过这之前,我不知道在哪里键入命令(甚至不知道是否本地或远程!!): ssh myuser@server.com mkdir .ssh scp〜/ .ssh / id_rsa.pub myuser@server.com:.ssh / authorized_keys

  2. 在我的本地开发机器上运行 msysgit ?有没有替代品,因为我安装的版本占用了1.4 GB!我从 msysGit-netinstall-1.7.4-preview20110204.exe > http://code.google.com/p/msysgit/downloads/list

我试过跳过git用户和公共密钥,在远程机器上创建存储库,但当我尝试 git remote add origin ssh:// [username] @ [domain / ip / hostname] / srv / git / [project -name] 作为root用户它说: fatal:不是git存储库(或任何父目录):.git

解决方案


  1. 我一直在尝试使用putty生成密钥对,但无法使其正常工作。最后我意识到我可以使用 ssh-keygen -Cgit@example.com-t rsa 通过msysgit命令行生成密钥。使用 nano /home/git/.ssh/authorized_keys 和hey presto将公钥复制到服务器中!

  2. 我已经下载了完整的源代码,因此大小!非源代码应用 Git-1.7.4-preview20110204.exe 仅为13MB,通过 http://code.google.com/p/msysgit/downloads/list?can=3

  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:

    1. 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 and scp ~/.ssh/id_rsa.pub myuser@server.com:.ssh/authorized_keys
    2. 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 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

    解决方案

    1. 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 using nano /home/git/.ssh/authorized_keys and hey presto!
    2. 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

    这篇关于如何在Linux上设置私人git服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆