IntroductionThis tutorial will exhibit you ways to put in place a centralized Git repository, which features an alternative comparable to a standard subversion work-flow, that has a centralized server.
This is not really a complicated approach; it really is only an extended sequence of straight forward methods.
Software RequirementsSoftware specifications would be the following:
msysgit 1.seven.0.two (Client and Server) CopSSH three.0.three (Server only) TortoiseGit 1.4.4.0 (Client only) The 32bit variations of your software program deals are linked. If installing for x64 on the server, substitute installation deals (and paths) appropriately. The x64 variations have not been tested about the server, and only the versions talked about right here are actually tested; ymmv.
On The Server Install msysgit 1.seven.0.2 Pick plink, not OpenSSH Opt for Git only on windows path (center solution) Set up CopSSH 3.0.3 to the server device Use default selections throughout set up By default, CopSSH installs to C:Program FilesICWModify CopSSH configuration: In C:Program FilesICWetcsshd_config, be certain the subsequent is uncommented and set to "no": PasswordAuthentication no 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. Its fine for these accounts to be "Limited",
Microsoft Office 2007, or non-Administrators. Activate these new user accounts in CopSSH: Start > Programs > Copssh > "Activate a user" Pick user account, leave other choices as default (/bin/bash, etc.) Type a passphrase. You must remember this passphrase: it happens to be associated with the private key for the user being activated. Finish. In C:Plan FilesICWhome, there is a subfolder for each user account: Inside each subfolder, send the <user>.key and <user>.key.pub files to the user,
Windows 7 Ultimate Key, 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:SeeDriveReposRepo1.git On D: D:DeeDriveReposRepo2.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) It 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 SeeDriveReposRepo.git. This does not change the subsequent discussion, except that the URL when specified from the consumer 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,
Microsoft Office 2010, and using file-based access from a clone of this repository about 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 around 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 to git.exe,
Office 2007, git-receive-pack.exe, git-upload-archive.exe, git-upload-pack.exe: $ ln -s /cygdrive/c/ProgramFiles(x86)/Git/bin/git.exe git.exe
$ ln -s /cygdrive/c/ProgramFiles(x86)/Git/libexec/git-core/git-receive-pack.exe git-receive-pack.exe
$ ln -s /cygdrive/c/ProgramFiles(x86)/Git/libexec/git-core/git-upload-archive.exe git-upload-archive.exe
$ ln -s /cygdrive/c/ProgramFiles(x86)/Git/libexec/git-core/git-upload-pack.exe git-upload-pack.exe About the ClientRequirements for consumer configurationYou must have been given: A private key file, e.g. <user>.key a pass phrase for 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:Plan Files (x86); For 32bit windows, just use C:Plan Files.) Set up msysgit one.seven.0.two Choose plink Decide git only on windows path Set up TortoiseGit one.4.4.0 After installation, under Settings > Network > SSH: SSH Client = C:Program Files (x86)TortoiseGitbinTortoisePlink.exe Potential gotcha: if you only give good results with other windows developers, you should consider disabling the auto-line-endings adjustment, and select the opportunity to leave line endings unchanged. Spurious diffs related to line-endings transformations are observed. Run C:Plan Files (x86)TortoiseGitbinputtygen.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:Plan Files (x86)TortoiseGitbinPageant.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. 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 just not running, and/or not correctly put together with the right key and passphrase, then set "Load Putty Key" (yes) = (route 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): determine yes. The repository should be successfully cloned. If this isn't the case,
Office 2007 Pro, be certain that that Pageant.exe is running, and has the correct .ppk key loaded. Cloning the repository about the D: drive of the server: URL = <user>@<server>:d:/DeeDriveRepos/Repo2 For repositories around the C: drive in the server, the subsequent URL will also give good results: URL = ssh://<user>@<server>/SeeDriveRepos/Repo1 This format cannot be used for repositories on other drives on the server.