在 Windows 上使用 msysgit 设置 Git 服务器

发布于 2024-08-05 10:13:24 字数 1539 浏览 5 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

帅冕 2024-08-12 10:13:25

可能根本就没有这样的指南。如果是这样,你可能不太幸运说服任何人写一个,因为这将是一项艰巨的工作。

我会推荐两件事之一。更简单的方法是盲目地遵循您的指南,这意味着忘记 msysgit。

更难的是建立一台 Linux 服务器 - 可能作为 Windows 下的访客使用 VirtualBox(免费)或 VMWare 或 Parallels(付费),然后按照 Google 引导您的多组说明中的一组进行操作。但您可能会发现这些说明是不够的 - 例如,它们通常假设您已经设置了 ssh 服务器,因此您必须从其他地方获取该信息。我已经这样做了两次,并且可以说,除非您已经是 Linux 大师,否则这将是一场斗争。

There may simply not be such a guide. If so, you may not have much luck convincing anybody to write one, because it would be a lot of work.

I would recommend either of two things. The easier one is to follow the guide you have slavishly, which means forgetting about msysgit.

The harder one is to put up a Linux server - perhaps as a guest under Windows using VirtualBox (free) or VMWare or Parallels (pay), and then follow one of the many sets of instructions Google will lead you to. But you will probably find those instructions are insufficient - they usually assume you've already set up an ssh server, for example, so you have to get that info elsewhere. I've done that twice, and can say that unless you're already something of a Linux guru, it will be a struggle.

丶视觉 2024-08-12 10:13:25

我做了 Bob Murphy 建议的“困难” “ 选项。

我在工作时在 VMWare Server(免费)下安装了 Ubuntu,然后按照 本指南有关设置 Gitosis。我发现它比尝试在 Windows 下运行要容易得多。一旦设置完毕,您实际上不必碰它,因为 Gitosis 管理可以通过 Windows 推送 gitosis.conf 文件的更新版本来完成。我需要直接在服务器上完成的任何工作都是通过 PuTTY 完成的,因此我不必使用可怕的 VMWare Server 界面。

我最近在家里摆弄 VirtualBox,发现它比 VMWare Server 更好用/更容易使用,所以它可能值得一看。

I did what Bob Murphy suggested was the "hard" option.

I installed Ubuntu under VMWare Server (free) at work and then followed this guide on setting up Gitosis. I found it much easier than trying to get it going under Windows. Once it's set up you really don't have to touch it because Gitosis administration can be done from Windows by pushing updated versions of the gitosis.conf file. Any work I do need to do on the server directly is done via PuTTY so I don't have to use the horrible VMWare Server interface.

I've recently been messing around with VirtualBox at home and I've found it much nicer/easier to work with than VMWare Server, so it may be worth looking at that.

雨的味道风的声音 2024-08-12 10:13:25

我只是想添加我在 Stevetimc 上面提到的 PATH 设置的经验:我在使用 shell 工具时遇到了权限问题(例如 >mvcp)将 Git 的 shell 可执行文件放在路径的前面。

将它们附加在现有的 PATH 之后,这解决了我的问题。示例:

GITPATH='/cygdrive/c/Program Files (x86)/Git/bin'
GITCOREPATH='/cygdrive/c/Program Files (x86)/Git/libexec/git-core'
PATH=${PATH}:${GITPATH}:${GITCOREPATH}

我猜 CopSSH 与所有 msysgit 的 shell 可执行文件都不能很好地配合...

I just wanted to add my experiences with the PATH setup that Steve and timc mentions above: I got permission problems using shell tools (like mv and cp) having Git's shell executables first in the path.

Appending them after the existing PATH instead this solved my problems. Example:

GITPATH='/cygdrive/c/Program Files (x86)/Git/bin'
GITCOREPATH='/cygdrive/c/Program Files (x86)/Git/libexec/git-core'
PATH=${PATH}:${GITPATH}:${GITCOREPATH}

I guess CopSSH doesn't go along well with all of msysgit's shell executables...

不一样的天空 2024-08-12 10:13:25

我在许多项目中使用 GitWebAccess 已有半年了,事实证明它是我使用过的最好的工具已经尝试过。不过,似乎最近的源不受支持,因此 - 不要采用最新的二进制文件/源。目前它们已损坏:(

您可以从此版本构建或下载我从此处使用的已编译二进制文件。

I'm using GitWebAccess for many projects for half a year now, and it's proven to be the best of what I've tried. It seems, though, that lately sources are not supported, so - don't take latest binaries/sources. Currently they're broken :(

You can build from this version or download compiled binaries which I use from here.

为你鎻心 2024-08-12 10:13:24

我发现了这篇文章,并且刚刚在我的博客上发布了一些可能有帮助的内容。

请参阅设置Windows 上带有 copSSH 的 Msysgit 服务器。虽然很长,但我已经成功地在 Windows 7 Ultimate x64 上运行了。

I found this post and I have just posted something on my blog that might help.

See Setting up a Msysgit Server with copSSH on Windows. It's long, but I have successfully got this working on Windows 7 Ultimate x64.

泼猴你往哪里跑 2024-08-12 10:13:24

Windows 版 Bonobo Git 服务器

Bonobo Git 服务器网页

Bonobo Git Server for Windows 是一个可以安装的 Web 应用程序
您的 IIS 并轻松管理和连接到您的 git 存储库。

Bonobo Git Server 是一个开源项目,您可以找到
github 上的源代码

功能:

  • 安全、匿名地访问您的 git 存储库
  • 用户友好的管理 Web 界面 基于
  • 用户和团队的存储库访问管理
  • 存储库文件浏览器
  • 提交浏览器
  • 本地化

Brad Kingsley 有一个很好的 安装和配置 Bonobo Git Server 的教程

GitStack

Git Stack 是另一种选择。以下是他们网站上的描述:

GitStack 是一款可让您设置自己的私人 Git 服务器的软件
对于 Windows。这意味着您创建了领先的版本控制
无需任何 Git 知识的系统。 GitStack 也让它变得超级
易于保护并使您的服务器保持最新状态。 GitStack 构建于
适用于 Windows 的正版 Git 的顶级版本,与任何
其他 Git 客户端。 GitStack 对于小型团队完全免费1

1基本版最多可供 2 位用户免费

Bonobo Git Server for Windows

From the Bonobo Git Server web page:

Bonobo Git Server for Windows is a web application you can install on
your IIS and easily manage and connect to your git repositories.

Bonobo Git Server is a open-source project and you can find the
source on github.

Features:

  • Secure and anonymous access to your git repositories
  • User friendly web interface for management
  • User and team based repository access management
  • Repository file browser
  • Commit browser
  • Localization

Brad Kingsley has a nice tutorial for installing and configuring Bonobo Git Server.

GitStack

Git Stack is another option. Here is a description from their web site:

GitStack is a software that lets you setup your own private Git server
for Windows. This means that you create a leading edge versioning
system without any prior Git knowledge. GitStack also makes it super
easy to secure and keep your server up to date. GitStack is built on
the top of the genuine Git for Windows and is compatible with any
other Git clients. GitStack is completely free for small teams1.

1 the basic edition is free for up to 2 users

天荒地未老 2024-08-12 10:13:24

关于 Tim Davis 页面的参考 - 在 Windows 上使用 copSSH 设置 Msysgit 服务器 - 我用它来获得在 Windows 7 Home Premium 64 上运行的 Git 服务器。

下面是事后分析/更新除了他的指示之外,我还学到了一些东西。

正如蒂姆·戴维斯所说,这是一个艰难而令人沮丧的过程,至少对我来说是这样——我不太擅长这种整合,但我在这个过程中学到了很多东西。我希望我的痛苦将来能够惠及其他人,因为这是一个艰难的过程。

  1. 有一个步骤是复制所有Git
    将可执行文件放入您的 CopSsh bin 中
    目录。而不是复制文件
    并找出哪些文件是
    需要时,将 git bin 路径添加到您的
    git 路径。我通过修改我的
    .bashrc 和 CopSsh 配置文件。

    以下是我添加到 .bashrc(在您的 CopSsh 和 Windows 主目录中)的内容:

    <块引用>

    gitpath='/cygdrive/c/Program Files (x86)/Git/bin'

    gitcorepath='cygdrive/c/Program Files (x86)/Git/libexec/git-core'

    路径=${gitpath}:${gitcorepath}:${PATH}

    这是我添加到 bash 配置文件中的内容(在 CopSsh 等/配置文件中):

    <块引用>

    gitpath='/c/Program Files (x86)/Git/bin'

    gitcorepath='cygdrive/c/Program Files (x86)/Git/libexec/git-core'

    导出 PATH="/bin:$syspath:$gitpath:$gitcorepath:$winpath"

    这里有一些重复 - 它对我有用,所以有人指出修改路径的正确位置。

  2. 较新的 msysgit 版本可能无法为您提供
    选择 ssh 的屏幕
    可执行文件,您可以在 Git 之间进行选择
    ssh 和 PuTTY ssh。你必须
    如果您使用 PuTTY,请手动设置 GIT_SSH。

  3. 我没有关注其中的一部分
    说明并且正在安装
    乌龟 - 我使用命令行
    相反,因为这就是我喜欢的方式
    学习 vcs,就像我学习 rcs 和 Subversion 一样
    发现这对我有用。我有
    克隆命令的问题
    使用 ssh。我是这样做的:

    使用 ssh 进行 Git 克隆 - 找不到存储库< /a>

    这是我最头疼的地方。

  4. CopSsh 安装目录是
    /程序文件 (x86)/ICW.我得到了
    远离这个,但如果我这样做
    再说一遍,我会使用目录名称
    没有空格。

  5. 这些其他来源帮助我解决了问题:

    设置 Git 服务器的另一种方法
    在 Windows 上:

    http://code.google.com/p/tortoisegit/wiki/HOWTO_CentralServerWindowsXP

    客户端:

    http://toolmantim.com/thoughts/setting_up_a_new_remote_git_repository

    Git 作为服务器的解释
    (与Windows无关,但更多
    深入查看而不是安装
    步骤):

    http://progit.org/book/ch4-0.html

    加上 O'Reilly 的使用 Git 进行版本控制 - 远程存储库章节。

回想起来,如果我知道这会多么耗时,我可能会开始使用 Mercurial,因为我读到 Windows 上的安装更容易,但在我使用 Git 一段时间后,我会对此有一个看法,然后尝试 Mercurial 。

With regards to the reference to the Tim Davis page - Setting up a Msysgit Server with copSSH on Windows - I used this to get a Git server running on Windows 7 Home Premium 64.

Below is a postmortem/update of what I learned in addition to his instructions.

Like Tim Davis said, this was an arduous and frustrating process, at least for me - I'm not too good with integration of this sort, but I learned alot in the process. I hope my pain benefits someone else in the future, because this was an arduous process.

  1. There is a step to copy all the Git
    executables into your CopSsh bin
    directory. Instead of copying files
    and figuring out which files are
    needed, add the git bin path to your
    git path. I did so by modifying my
    .bashrc and CopSsh profile.

    Here's what I added to .bashrc (in your CopSsh and Windows home directory):

    gitpath='/cygdrive/c/Program Files (x86)/Git/bin'

    gitcorepath='cygdrive/c/Program Files (x86)/Git/libexec/git-core'

    PATH=${gitpath}:${gitcorepath}:${PATH}

    Here's what I added to the bash profile (in CopSsh etc/profile):

    gitpath='/c/Program Files (x86)/Git/bin'

    gitcorepath='cygdrive/c/Program Files (x86)/Git/libexec/git-core'

    export PATH="/bin:$syspath:$gitpath:$gitcorepath:$winpath"

    There is some duplication here - it works for me, so someone chime in which is the correct place to modify the path.

  2. The newer msysgit versions might not give you
    the screen to choose the ssh
    executable where you choose between the Git
    ssh and PuTTY ssh. You'll have to
    set GIT_SSH manually if you use PuTTY.

  3. I didn't follow one part of the
    instructions and that was installing
    Tortoise - I used the command line
    instead as that's how I prefer to
    learn a vcs like I did with rcs and Subversion and
    found that to work for me. I had
    problems with the clone command
    using ssh. Here's how I did it:

    Git clone using ssh - can't find repository

    This is where I banged my head the most.

  4. The CopSsh install directory was
    /Program Files (x86)/ICW. I got
    away with this, but if I were doing
    it again, I'd use a directory name
    with no spaces.

  5. These other sources helped me figure things out:

    Another way to setup a Git server
    on Windows:

    http://code.google.com/p/tortoisegit/wiki/HOWTO_CentralServerWindowsXP

    The client side of things:

    http://toolmantim.com/thoughts/setting_up_a_new_remote_git_repository

    An explanation of Git as a server
    (not related to Windows, but a more
    in depth look than installation
    steps):

    http://progit.org/book/ch4-0.html

    Plus O'Reilly's Version Control with Git - the Remote Repositories chapter.

In retrospect, if I had known how time consuming this would be, I might have started out with Mercurial as I read the install on Windows is easier, but I'll have an opinion on that after I work with Git awhile and then try Mercurial.

彩扇题诗 2024-08-12 10:13:24

我不知道为什么没有人建议 http://gitblit.com。纯基于java的解决方案,允许HTTP协议并且非常容易设置。

I am not sure why anyone hasn't suggested http://gitblit.com. Pure java based solution, allow HTTP protocol and really easy to setup.

被你宠の有点坏 2024-08-12 10:13:24

在遵循 Tim Davis 的指南和 Steve 的后续操作后,我做了以下操作:

服务器 PC

  1. 安装 CopSSH、msysgit。
  2. 创建 CopSSH 用户时,取消选中“密码身份验证”并选中“公钥身份验证”,以便您的公钥/私钥生效。
  3. 使用 PuTTygen 创建公钥/私钥。将两个密钥放入用户的 CopSSH/home/user/.ssh 目录中。
  4. 将以下内容添加到用户的 CopSSH/home/user/.bashrc 文件中:

    GITPATH='/cygdrive/c/Program Files (x86)/Git/bin'
    GITCOREPATH='/cygdrive/c/Program Files (x86)/Git/libexec/git-core'
    路径=${GITPATH}:${GITCOREPATH}:${PATH}
    
  5. 打开 Git Bash 并在 PC 上的任何位置创建存储库:

    $ git --bare init repo.git
    在 C:/repopath/repo.git/ 中初始化空 Git 存储库
    

客户端 PC

  1. 安装 msysgit。
  2. 使用您在服务器上创建的私钥从 ssh://user@server:port/repopath/repo.git 克隆您的存储库(由于某种原因,根目录是 C: 驱动器

)允许我成功克隆和提交,但我无法推送到服务器上的裸存储库。我不断收到:

git: '/repopath/repo.git' is not a git command. See 'git --help'.
fatal: The remote end hung up unexpectedly

这让我找到 Rui 的跟踪和解决方案 用于在客户端 PC 的 %USERPROFILE% 路径 (C:\Users\UserName) 中创建或添加以下行到 .gitconfig。

[remote "origin"]
    receivepack = git receive-pack

我不确定为什么需要这样做......如果有人可以提供见解,这会很有帮助。

我的git版本是1.7.3.1.msysgit.0

After following Tim Davis' guide and Steve's follow-up, here is what I did:

Server PC

  1. Install CopSSH, msysgit.
  2. When creating the CopSSH user, uncheck Password Authentication and check Public Key Authentication so your public/private keys will work.
  3. Create public/private keys using PuTTygen. put both keys in the user's CopSSH/home/user/.ssh directory.
  4. Add the following to the user's CopSSH/home/user/.bashrc file:

    GITPATH='/cygdrive/c/Program Files (x86)/Git/bin'
    GITCOREPATH='/cygdrive/c/Program Files (x86)/Git/libexec/git-core'
    PATH=${GITPATH}:${GITCOREPATH}:${PATH}
    
  5. Open Git Bash and create a repository anywhere on your PC:

    $ git --bare init repo.git
    Initialized empty Git repository in C:/repopath/repo.git/
    

Client PC

  1. Install msysgit.
  2. Use the private key you created on the server to clone your repo from ssh://user@server:port/repopath/repo.git (for some reason, the root is the C: drive)

This allowed me to successfully clone and commit, but I could not push to the bare repo on the server. I kept getting:

git: '/repopath/repo.git' is not a git command. See 'git --help'.
fatal: The remote end hung up unexpectedly

This led me to Rui's trace and solution which was to create or add the following lines to .gitconfig in your Client PC's %USERPROFILE% path (C:\Users\UserName).

[remote "origin"]
    receivepack = git receive-pack

I am not sure why this is needed...if anybody could provide insight, this would be helpful.

my git version is 1.7.3.1.msysgit.0

故事还在继续 2024-08-12 10:13:24

GitStack 应该可以满足您的目标。我有一个向导设置。
它对 2 位用户免费,并具有基于 Web 的用户界面。它基于 msysgit。

GitStack should meet your goal. I has a wizard setup.
It is free for 2 users and has a web based user interface. It is based on msysgit.

妄司 2024-08-12 10:13:24

有一个很好的开源 Git 堆栈,称为 Git Blit。它可用于不同的平台和不同的软件包。您还可以轻松地将其部署到现有的 Tomcat 或任何其他 servlet 容器。查看点击几下即可在 Windows 上设置 git 服务器教程了解更多详细信息,它将带您了解更多信息10 分钟即可完成基本设置。

There is a nice open source Git stack called Git Blit. It is available for different platform and in different packages. You can also easily deploy it to your existing Tomcat or any other servlet container. Take a look at Setup git server on windows in few clicks tutorial for more details, it will take you around 10 minutes to get basic setup.

零時差 2024-08-12 10:13:24

您不需要 SSH 来共享 git。如果您使用 LAN 或 VPN,则可以将 git 项目导出为共享文件夹,并将其安装到远程计算机上。然后使用“file://”URL 而不是“git@”URL 配置远程存储库。总共需要 30 秒。完毕!

You don't need SSH for sharing git. If you're on a LAN or VPN, you can export a git project as a shared folder, and mount it on a remote machine. Then configure the remote repo using "file://" URLs instead of "git@" URLs. Takes all of 30 seconds. Done!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文