我如何托管Git存储库并管理我自己的内容托管? [英] How can I host Git repositories and manage my content-hosting myself?

查看:124
本文介绍了我如何托管Git存储库并管理我自己的内容托管?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

诸如Github,Bitbucket,DropBox之类的东西管理门票和回购托管等内容托管(DB不是门票,但可用于存储回购)。我想要一个解决方案,让我管理自己的内容托管的东西,如Git的仓库和门票。


试用版0:试图调整Git,太耗时


我按照指示
这里
但是有一些困难,于是我跟着很多其他的教程用了
更多的困难。我克隆了git clone --bare xxx
xxx.git; cd xxx; git update-server-info
工作但无法推送
- 共享的东西,受够了这种手动黑客。
过多的材料,太多不相关的材料以及过多的
过期材料。


我再说一遍,我想自己做内容托管。那么我怎么能托管我的git回购?

也许有关



  1. Git存储库服务器我可以托管本地


  2. 个人项目代码托管建议

  3. >解决方案

如果您正在运行Linux服务器,则可以选择使用Git + SSH。

/ strong>


  1. 创建一个名为 git 的用户帐户,在你的主要git项目目录中。这对于允许所有协作者推送共享项目很有用。

  2. 将每台客户端计算机的RSA公钥添加到授权服务器上的authorized_keys 文件。 (您可以在大多数Linux发行版上使用 ssh-keygen -t rsa -b 4096 生成一个私钥 - 公钥对。)

  3. 为您的项目创建一个新的裸仓库,作为 git 用户。 git init myproject --bare


开客户


  1. 通过启用 IdentifyFile ssh_config


  2. 克隆裸仓库。 git clone git @< server>:/ var / git / myproject

  3. 进行更改。 提交更改并将其推回到远程仓库。 git push origin master




  4. 如果您需要更具体的说明(例如创建用户帐户的确切命令)签出官方 Pro Git 书。


    Things such as Github, Bitbucket, DropBox -- manages the content-hosting such as tickets and repo -hosting (DB not tickets but can be used to store repos). I want a solution where I manage myself the content-hosting of thing such as Git -repositories and tickets.

    Trial 0: trying to tune Git, too time-consuming

    I followed the instructions here but some difficulties then I followed a lot of other tutorials with much more difficulties. I got cloning with "git clone --bare xxx xxx.git; cd xxx; git update-server-info" working but unable to push things with "--shared", got fed up to this kind of manual hacks. There is too much material, too much irrelevant material and too much outdated material.

    I repeat I want to do the content-hosting myself. So how can I host my git repos?

    Perhaps related

    1. Git repository server I can host locally

    2. Recommendation for code hosting of personal projects

    解决方案

    If you're running a Linux server an option is to use Git + SSH.

    On The Server

    1. Create a user account called git which has permissions over your main git project directory. This is useful for allowing all collaborators to push on shared projects.

    2. Add the RSA public key for each of your client machines to the authorized_keys file on the server. (You can generate a private-public key pair using ssh-keygen -t rsa -b 4096 on most Linux distributions.)

    3. Create a new bare repository for your project as the git user. git init myproject --bare

    On the Client

    1. Turn on private key authentication by enabling the IdentifyFile in your ssh_config.

    2. Clone the bare repository. git clone git@<server>:/var/git/myproject

    3. Make your changes.

    4. Commit the changes and push them back to the remote repo. git push origin master

    If you need more specific instructions (such as the exact commands to create a user account) checkout the official Pro Git book.

    这篇关于我如何托管Git存储库并管理我自己的内容托管?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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