原文地址:http://code.google.com/p/tortoisegit/wiki/HOWTO_CentralServerWindowsXP
Introduction
This guide will show you how to set up a centralized Git repository, which offers an option similar to a conventional subversion work-flow, with a centralized server.
This is not a difficult process; it is only a long sequence of simple steps.
Software Requirements
Software requirements are the following:
The 32bit versions of the software packages are linked. If installing for x64 on theserver, substitute installation packages (and paths) appropriately. The x64 versions have not been tested on the server, and only the versions mentioned here have
been tested; ymmv.
On The Server
- Installmsysgit 1.7.0.2
- Choose plink,not OpenSSH
- Choose Git only on windows path (middle option)
- InstallCopSSH 3.0.3on the server machine
- Use default options during installation
- By default, CopSSH installs toC:\Program Files\ICW\
- Modify CopSSH configuration:
- On server, in Windows:
- Control Panel > User Accounts > Create new account
- Create an account for each user to whom you wish to allow SSH access.
- It is fine for these accounts to be "Limited", or non-Administrators.
- Activate these new user accounts in CopSSH:
- Start > Programs > Copssh > "Activate a user"
- Choose user account, leave other options as default (/bin/bash, etc.)
- Type a passphrase.You must remember this passphrase: it is associated with the private key of the user being activated.
- Finish.
- InC:\Program Files\ICW\home, there is a subfolder for each user account:
- Inside each subfolder, send the<user>.keyand<user>.key.pubfiles
to the user, along with the pass phrase selected in (5) FOR THAT USER. They will need this information.
- Make a git repository:
- Lets assume we want to serve 2 repos: one on C: drive and one on D: drive
- On C:C:\SeeDriveRepos\Repo1\.git
- On D:D:\DeeDriveRepos\Repo2\.git
- For each parent folder, e.g.C:\SeeDriveRepos:
- Right Click > Sharing and Security > Security > Users: "Modify" = Checked (note that "Write" becomes checked as well, which is fine)
- This is needed for when a remote client wants to Push.
- NOTE: It will be more likely that the central server will host a bare git repository. In this instance, thefoldername will be something like\SeeDriveRepos\Repo.git.
This does not change the subsequent discussion, except that the URL when specified from the client side must obviously match the folder name above, in terms ofRepo.git.
-
Potential Gotcha: If you access and commit into this repository locally, in other words, while logged into the server directly, and using file-based access from a clone of this repository on the same server, then the
HEADS file representing that branch will take on the security privileges of that user. In other words, doing this while logged in as Administrator will prevent all other non-admin users from modifying that HEADS file: they will be unable to make commits to
that branch. There are various workarounds for this, including changing the write permissions on the folder tree of that repository to be valid for all ssh-enabled users, or making all ssh-user accounts (the Windows accounts) administrators, and so on.
- On server, ensure that the Firewall has port 22 open. This will allow incoming SSH traffic. Any other port-blocking software or hardware should have the same port open.
- The ssh server won't be able to find the required Git EXEs yet.
- Start > CopSSH > Start a unix bash shell.On at least Windows 7, this action must be performed while logged in under an Administrator account.
- cd /Bin
- Create a symbolic link togit.exe,git-receive-pack.exe,git-upload-archive.exe,git-upload-pack.exe:
$ ln -s /cygdrive/c/Program\ Files\ \(x86\)/Git/bin/git.exe git.exe
$ ln -s /cygdrive/c/Program\ Files\ \(x86\)/Git/libexec/git-core/git-receive-pack.exe git-receive-pack.exe
$ ln -s /cygdrive/c/Program\ Files\ \(x86\)/Git/libexec/git-core/git-upload-archive.exe git-upload-archive.exe
$ ln -s /cygdrive/c/Program\ Files\ \(x86\)/Git/libexec/git-core/git-upload-pack.exe git-upload-pack.exe
On The Client
Requirements for client configuration
You must have been given:
- Aprivatekey file, e.g.<user>.key
- apass phrasefor the same private key
- a user name to use, e.g.<user>
- The name of a server, e.g.<server>
Configuration procedure
(NOTE: The path for program files below is for Windows XP x64, i.e.C:\Program Files (x86)\; For 32bit windows, just
useC:\Program Files.)
- Installmsysgit 1.7.0.2
- Choose plink
- Choose git only on windows path
- InstallTortoiseGit 1.4.4.0
- After installation, under Settings > Network > SSH:
SSH Client =C:\Program Files (x86)\TortoiseGit\bin\TortoiseGitPLink.exe
- Potential gotcha: if you only work with other windows developers, you should consider disabling the auto-line-endings adjustment, and select the option to leave line endings unchanged. Spurious diffs related to line-endings transformations
have beenobserved.
- RunC:\Program Files (x86)\TortoiseGit\bin\puttygen.exe:
- The keys generated in CopSSH areOpenSSHkeys, but we want to useputtykeys with TortoiseGit; here, we convert the private key to a putty type.
- Click button "Load" > Select file<user>.key
- Save the converted private key somewhere, e.g.<user>.ppk
- Close puttygen
- RunC:\Program Files (x86)\TortoiseGit\bin\Pageant.exe
-
Addthe newly created<user>.ppk
- Enter the pass phrase for the private key when asked
- NOTE: On every reboot,Pageant.exemust be started, and the key loaded, and the pass
phrase entered.
- Clone the repositories from the server. Let's start with the C drive repo:
- find a suitable location, and Right Click > Git Clone:
- URL =<user>@<server>:c:/SeeDriveRepos/Repo1
- IfPageant.exeis not running, and/or not correctly set up with the right key and passphrase,
then set "Load Putty Key" (yes) = (path to<user>.ppk). WithoutPageant.exe,
you will be asked for your passphrase on every action.
- click OK
- A dialog will come up, asking whether ssh host information should be saved (yes/no): choose yes.
- The repository should be successfully cloned.If this is not the case, make sure thatPageant.exeis
running, and has the correct.ppkkey loaded.
- Cloning the repository on the D: drive of the server:
- URL =<user>@<server>:d:/DeeDriveRepos/Repo2
- For repositories on the C: drive of the server, the following URL will also work:
- URL =ssh://<user>@<server>/SeeDriveRepos/Repo1
- This format cannot be used for repositories on other drives of the server.
分享到:
相关推荐
在Windows操作系统上搭建Git服务器,通常我们会选择使用CopSSH作为SSH服务器组件,因为Git原生并不支持Windows上的SSH服务。本文将详细介绍如何在Windows环境中利用Git和CopSSH来创建一个安全、高效的版本控制系统。...
本文将详细介绍如何通过copSSH在Windows XP上搭建Git服务器,并使用TortiseGit作为客户端工具进行日常操作。 #### 二、准备工作 1. **下载copSSH**: copSSH是一款强大的SSH服务器软件,可以从[SourceForge]...
在 Windows 上搭建 Git 服务器可以通过以下步骤实现。首先,在客户端上安装 TortoiseGit 和 MSysGit,完成后可以在本地使用 Git。然后,生成密钥对,并将公钥部分复制到文本文件中。接着,安装 copssh 和 MSysGit 在...
在Windows XP上搭建Git服务器,主要是为了让其他开发者能够通过SSH协议访问和协作代码仓库。本文主要分为三个步骤:安装Git,安装CopSSH以及配置CopSSH以支持Git。 首先,安装Git。Git是一款分布式版本控制系统,它...
windows 下git服务器的搭建(密码登陆) windows git copssh tortoisegit
在Windows 2003上搭建GIT服务器,你需要安装两种主要软件:Msysgit和Copssh。Msysgit是GIT在Windows平台下的版本,而Copssh是一个SSH服务器软件,它允许通过SSH协议安全地访问Windows系统。你需要从相应的官方网站...
本文将详细介绍如何在Windows环境下搭建Git服务器,并实现通过SSH密钥进行无密码登录的方式。 #### 二、准备工作 在正式开始之前,我们需要确保以下几个软件已经安装完成: 1. **TortoiseGit**:一个用于Windows...
本文将指导读者在 Windows 环境下搭建基于 SSH 的 Git 服务器,使用 msysgit 和 copssh 软件实现 Git 服务器的搭建和配置。 一、安装必要软件 在开始搭建 Git 服务器之前,需要安装两个软件:msysgit 和 copssh。...
【Git copssh搭建】是指在Windows环境中通过CopSSH和Git构建一个安全的SSH服务,使得开发者可以通过SSH协议访问和管理Git仓库。以下是搭建过程的详细步骤: 1. **下载相关软件**: - Copssh: 提供SSH服务,用于...
在Windows XP上搭建Git服务器可以让开发者通过网络进行代码的提交、拉取和同步。 2. **CopSSH**:CopSSH是Windows上的一个开放SSH服务套件,它基于OpenSSH,提供了在Windows系统上搭建SSH服务器的功能,支持SSH连接...
搭建Git服务器的过程主要分为两大部分:安装Git软件和设置Copssh服务。首先,我们需要准备两个关键软件,即Git和Copssh。Git是分布式版本控制系统,而Copssh则是一个用于Windows系统的SSH服务器,它允许我们通过SSH...
本文将讲解如何在Windows下搭建基于ssh的git服务器,涵盖了msysgit和copssh的安装、配置、使用等方面的知识点。 1. msysgit的安装 msysgit是Windows平台下的Git客户端,可以从Google Code上下载最新的版本。安装时...
copssh就是为了给windows安装个ssh服务,然后自己弄个git服务器试试,突然发现电脑里的copssh安装包不见了, 下载大家的,修改成免费的,怎么修改?
在Windows环境下搭建Git版本控制环境是一项技术任务,对于开发者来说是必须掌握的技能之一。此过程涉及到了使用多个工具,比如Putty、Msysgit和Copssh,它们在Windows系统中实现Git版本控制中扮演着不同的角色。 ...
Windows 下搭建基于 ssh 的 git 服务器 Git 是一个开源的版本控制系统,广泛应用于软件开发领域。...通过安装必备软件、配置 Git 和 copssh、实现基于 ssh 的 Git 服务器,可以轻松地实现版本控制和协作开发。
【搭建Windows服务器上的SSH GIT...通过以上步骤,你可以在Windows服务器上成功搭建一个基于SSH的Git服务器,从而实现安全、高效的代码版本控制和团队协作,尤其对于区块链项目的开发,这种版本管理机制尤为重要。
【Git搭建文档】这篇教程详细介绍了如何在Windows服务器和客户端上搭建Git环境,结合TortoiseGit和COPSSH进行SSH安全连接。首先,我们需要准备三个主要的软件:Git、COPSSH和TortoiseGit。 **服务器端安装及部署** ...
在本文中,我们将深入探讨CopSSH的安装、配置和使用,以及它在Windows上搭建Git服务器中的应用。 1. **安装CopSSH**: CopSSH的安装文件为`Copssh_4.1.0_Installer-HedgehogM.exe`,这是一份可执行的安装程序。...
首先,搭建Git服务器需要以下软件:msysGit和CopSSH。msysGit是Git在Windows上的实现,而CopSSH是一个用于Windows的SSH服务器,它允许通过SSH协议安全地访问和操作服务器上的文件。安装这两个工具时,要注意避免在...