在局域网上创建远程服务器而不是使用 Git Hub

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21273826/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:37:29  来源:igfitidea点击:

Creating a remote server on a LAN instead of using Git Hub

gitlancollaborationgit-bash

提问by Umair Cheema

Can I create my own remote server instead of using Git Hub?

我可以创建自己的远程服务器而不是使用 Git Hub 吗?

i.e Can I make a remote server on LAN where 3 computers are sharing a drive on a network to do the collaborative work using Gitbash? ?

即我可以在 LAN 上创建一个远程服务器,其中 3 台计算机在网络上共享一个驱动器以使用 Gitbash 进行协作工作吗??

采纳答案by First Zero

There are several ways to do this

做这件事有很多种方法

  1. Host internal repositories like Gitlabor Stash. This will be similar to services like BitBucket or GitHub
  2. If you want to have a simple service with SSH authentication - user3159253 has already answered that
  3. A very bare bones way is
    1. server: Create a bare repo: mkdir -p RepoName && git init RepoName --bare
    2. server: Start the git daemon: git daemon --base-path=$PWD/RepoName
    3. client:
      Add your remote: git remote add origin git://server.url.or.ip/RepoName
      or just clone it: git clone git://server.url.or.ip/RepoName
  1. 托管内部存储库,如GitlabStash。这将类似于 BitBucket 或 GitHub 等服务
  2. 如果您想使用 SSH 身份验证的简单服务 - user3159253 已经回答了
  3. 一个非常简单的方法是
    1. 服务器:创建一个裸仓库: mkdir -p RepoName && git init RepoName --bare
    2. 服务器:启动 git 守护进程: git daemon --base-path=$PWD/RepoName
    3. 客户端:
      添加您的遥控器:git remote add origin git://server.url.or.ip/RepoName
      或只是克隆它:git clone git://server.url.or.ip/RepoName

回答by user3159253

Yes, you do. Actually you need a SSH-service and git would perfectly work over SSH. Since you're on Windows, see Setup a Git server with msysgit on Windows

是的你是。实际上,您需要一个 SSH 服务,而 git 可以完美地通过 SSH 工作。由于您使用的是 Windows,请参阅在 Windows 上使用 msysgit 设置 Git 服务器

回答by Noufal Ibrahim

You can set up a remote repository and make it accessible through any of the protocolsit supports. The AAA would be handled by the transport.

您可以设置远程存储库并使其可通过它支持的任何协议进行访问。AAA 将由传输处理。