我如何托管Git存储库并管理我自己的内容托管? [英] How can I host Git repositories and manage my content-hosting myself?
问题描述
试用版0:试图调整Git,太耗时
我按照指示
这里
但是有一些困难,于是我跟着很多其他的教程用了
更多的困难。我克隆了git clone --bare xxx
工作但无法推送
xxx.git; cd xxx; git update-server-info
用- 共享
的东西,受够了这种手动黑客。
过多的材料,太多不相关的材料以及过多的
过期材料。
我再说一遍,我想自己做内容托管。那么我怎么能托管我的git回购?
也许有关
- >解决方案
如果您正在运行Linux服务器,则可以选择使用Git + SSH。
/ strong>
-
创建一个名为
git
的用户帐户,在你的主要git项目目录中。这对于允许所有协作者推送共享项目很有用。
-
将每台客户端计算机的RSA公钥添加到
授权服务器上的authorized_keys
文件。 (您可以在大多数Linux发行版上使用ssh-keygen -t rsa -b 4096
生成一个私钥 - 公钥对。)
-
为您的项目创建一个新的裸仓库,作为
git
用户。git init myproject --bare
开客户
-
通过启用
IdentifyFile $ c打开私钥验证$ c $> ssh_config
。 -
克隆裸仓库。
git clone git @< server>:/ var / git / myproject $>
进行更改。 提交更改并将其推回到远程仓库。
git push origin master
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.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 usingssh-keygen -t rsa -b 4096
on most Linux distributions.)Create a new bare repository for your project as the
git
user.git init myproject --bare
Turn on private key authentication by enabling the
IdentifyFile
in yourssh_config
.Clone the bare repository.
git clone git@<server>:/var/git/myproject
Make your changes.
Commit the changes and push them back to the remote repo.
git push origin master
如果您需要更具体的说明(例如创建用户帐户的确切命令)签出官方 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
If you're running a Linux server an option is to use Git + SSH.
On The Server
On the Client
If you need more specific instructions (such as the exact commands to create a user account) checkout the official Pro Git book.
这篇关于我如何托管Git存储库并管理我自己的内容托管?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!