`
xinlanzero
  • 浏览: 253128 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

TortoiseGit + msysgit + CopSSH + WindowsXP as server

 
阅读更多

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 the server, 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

  1. Install msysgit 1.7.0.2
    • Choose plink, not OpenSSH
    • Choose Git only on windows path (middle option)
  2. Install CopSSH 3.0.3 on the server machine
    • Use default options during installation
    • By default, CopSSH installs to C:\Program Files\ICW\
  3. Modify CopSSH configuration:
    • In C:\Program Files\ICW\etc\sshd_config, make sure the following is uncommented and set to "no":
    PasswordAuthentication no
  4. 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.
  5. 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.
  6. In C:\Program Files\ICW\home, there is a subfolder for each user account:
    • Inside each subfolder, send the <user>.key and <user>.key.pub files to the user, along with the pass phrase selected in (5) FOR THAT USER. They will need this information.
  7. 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, the folder name 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 of Repo.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.
  8. 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.
  9. The ssh server won't be able to find the required Git EXEs yet.
    1. Start > CopSSH > Start a unix bash shell. On at least Windows 7, this action must be performed while logged in under an Administrator account.
    2. cd /Bin
    3. Create a symbolic link to git.exe, git-receive-pack.exe, git-upload-archive.exe, git-upload-pack.exe:
    4. $ 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:

  1. A private key file, e.g. <user>.key
  2. a pass phrase for the same private key
  3. a user name to use, e.g. <user>
  4. 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 use C:\Program Files.)

  1. Install msysgit 1.7.0.2
    • Choose plink
    • Choose git only on windows path
  2. Install TortoiseGit 1.4.4.0
    • After installation, under Settings > Network > SSH:
    • 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 been observed.
  3. SSH Client = C:\Program Files (x86)\TortoiseGit\bin\TortoisePlink.exe
  4. Run C:\Program Files (x86)\TortoiseGit\bin\puttygen.exe:
    • The keys generated in CopSSH are OpenSSH keys, but we want to use putty keys 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
    • Run C:\Program Files (x86)\TortoiseGit\bin\Pageant.exe
    • Add the newly created <user>.ppk
    • Enter the pass phrase for the private key when asked
    • NOTE: On every reboot, Pageant.exe must be started, and the key loaded, and the pass phrase entered.
  5. 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
      • If Pageant.exe is not running, and/or not correctly set up with the right key and passphrase, then set "Load Putty Key" (yes) = (path to <user>.ppk). Without Pageant.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 that Pageant.exe is running, and has the correct .ppk key loaded.
  6. Cloning the repository on the D: drive of the server:
    • URL = <user>@<server>:d:/DeeDriveRepos/Repo2
  7. 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+TortoiseGit+COPSSH安装图文教程

    根据提供的文件信息,本篇图文教程主要涵盖了在Windows平台上安装和配置Git、TortoiseGit以及COPSSH的关键步骤和知识点,具体内容如下: 1. 安装准备工作: - Git安装文件 Git-*.*.*.*-preview***.exe 可从 *** ...

    TortoiseGit和msysGit安装及使用笔记

    对于Windows用户来说,TortoiseGit 和 msysGit 是非常实用的工具组合。本文将详细介绍这两款工具的安装与基本使用方法,帮助初学者更好地管理自己的代码。 #### 二、msysGit安装 1. **下载msysGit** - 访问官方...

    MsysGit+TortoiseGit+简体中文包

    在实际使用中,首先需要下载MsysGit+TortoiseGit+简体中文包的压缩文件,例如"\MsysGit+TortoiseGit+简体中文包.zip"。解压缩后,按照安装指南进行安装,通常包括以下几个步骤: 1. 安装MsysGit:这一步会设置Git的...

    win7下Git+TortoiseGit+COPSSH安装包

    此压缩包,包含了 TortoiseGit-1.8.11.0-32bit.msi、 Copssh_4.1.0_Installer、 Git-1.9.2-preview20140411.exe和Git-1.9.4-preview20140929.exe(皆可使用)

    Git-1.8.1.2-preview20130201+TortoiseGit_1.8.14.0+Copssh_4.1.0_Installer

    标题和描述中提到的软件组合是Git、TortoiseGit和CopSSH的特定版本安装包。这些工具在IT行业中主要用于版本控制和远程服务器访问,特别适用于Windows操作系统。 **Git** 是一个分布式版本控制系统,由Linus ...

    git+tortoisegit+汉化包

    这个“git+tortoisegit+汉化包”组合旨在为Windows用户提供一个完整的Git环境,同时解决了语言障碍问题,使中文用户可以更轻松地理解和操作Git。 Git的核心特性包括: 1. 分布式:每个开发者的本地机器上都有一个...

    TortoiseGit+LanguagePack-2.15.0.0-64bit

    本文将围绕“TortoiseGit+LanguagePack-2.15.0.0-64bit”这一主题,详细介绍TortoiseGit的安装、基本操作以及如何利用语言包进行多语言设置。 首先,我们来看TortoiseGit的安装。在提供的压缩包文件中,有两个重要...

    TortoiseGit+GIT

    Git是一款分布式版本控制系统,而TortoiseGit是Git的一个图形化界面,专为Windows用户设计,提供了更直观的操作方式。 **Git基础** Git由Linux之父Linus Torvalds开发,其主要功能是跟踪对文件或项目的所有修改,...

    Git+TortoiseGit+中文语言包 分布式版本控制系统

    总之,Git+TortoiseGit+中文语言包的组合为Windows用户提供了一个强大且易用的版本控制解决方案,极大地促进了团队间的协作和代码管理。通过理解并运用Git的核心概念和TortoiseGit的功能,开发者可以更高效地管理...

    git+TortoiseGit+TortoiseGit汉化工具

    总之,Git+TortoiseGit+TortoiseGit汉化工具的组合为Windows用户提供了强大的版本控制环境,无论你是初学者还是经验丰富的开发者,都能从中受益。通过熟悉这些工具的使用,你将能更好地掌控项目开发过程,实现高效、...

    TortoiseGit+中文汉化

    在这个“TortoiseGit+中文汉化”主题中,我们将深入探讨TortoiseGit的基本功能、安装过程以及中文汉化的方法。 首先,Git是一种分布式版本控制系统,它允许开发者追踪和管理项目中的文件变更,方便多人协作开发。...

    Git+TortoiseGit+语言包.zip

    在这个“Git+TortoiseGit+语言包.zip”压缩包中,我们很可能找到了安装Git和TortoiseGit所需的所有组件,以及可能包含的不同语言包,以支持多语言环境下的使用。 Git的核心功能包括: 1. 版本控制:Git可以记录文件...

    Git+TortoiseGit+sourcetree

    总结来说,Git+TortoiseGit+SourceTree这套组合为Windows用户提供了高效、直观的版本控制解决方案。Git的强大功能加上TortoiseGit和SourceTree的易用性,使得代码管理和协作变得更加简单,是开发团队不可或缺的工具...

    最新版git+tortoiseGit+汉化包

    在"最新版git+tortoiseGit+汉化包"中,我们可以理解为这个压缩包包含了最新版本的Git和TortoiseGit,以及可能的中文语言包。Git的最新版本通常会修复已知问题,提高性能,增加新功能,确保用户可以使用到最稳定、最...

    Git + TortoiseGit + 中文语言包

    TortoiseGit是基于Git的一个图形化用户界面,专为Windows用户设计,使得操作Git变得更加直观和便捷。在这个“Git + TortoiseGit + 中文语言包”中,我们包含了Git的64位版本、TortoiseGit的安装程序以及TortoiseGit...

    在Gtiee搭建仓库传代码/多人开发/个人代码备份-git同步-TortoiseGit+TortoiseSVN

    在Gtiee搭建仓库传代码/多人开发/个人代码备份---git同步---TortoiseGit+TortoiseSVN软件安装包

    TortoiseGit+比较工具

    TortoiseGit是一款基于Git版本控制系统并专为Windows用户设计的图形化界面工具。它提供了一套完整的Git命令行接口,并将其集成到Windows资源管理器中,使得用户在熟悉的环境中进行版本控制操作。TortoiseGit支持创建...

    64位TortoiseGit+中文包+客户端

    TortoiseGit是一款在Windows操作系统上使用的Git图形界面客户端,它为用户提供了与Git命令行接口相集成的直观且便捷的界面。TortoiseGit不仅适用于初学者,也适合对Git有深入理解的开发人员。这款工具通过与Windows...

    Git+TortoiseGit+中文包.zip

    Git-2.26.2-64-bit.exe + TortoiseGit-2.10.0.2-64bit.msi + TortoiseGit-LanguagePack-2.10.0.0-64bit-zh_CN.msi 打包下载

Global site tag (gtag.js) - Google Analytics