Sunday, 20 September 2009
For best results use one of the following Git versions:
- Git 184.108.40.206 - recommended
- Git 220.127.116.11
- Git 18.104.22.168
- Git 22.214.171.124
- Git source code, current version is git-126.96.36.199.tar.gz
- msysGit full install, current version is msysGit-fullinstall-1.6.4-preview20090729.exe
Setting up Git
First unpack msysGit installer to your desired location (7-Zip works just fine). In my case, the location is K:devtoolsmsysGit. Also, this folder is the root folder inside the msysGit shell, and would be the reference for the rest of the tutorial.
In the K:devtoolsmsysGitgit folder you will find the Git source code provided with the installer. Delete all the files and folders inside it, and then unpack in the same folder the source code of your desired git version.
Final step would be running K:devtoolsmsysGitmsys.bat, which will compile and install git, and leave you to a shell prompt.
At this prompt, you could add a desktop shortcut to msysGit shell:
The other possible actions are:
Usage: K:/dev/tools/msysGit/share/msysGit/add-shortcut.tcl [option] Options: QuickLaunch create a QuickLaunch icon Desktop create an icon on the Desktop StartMenu create an icon in your start menu StartMenu2 create an icon in start menu's Programs>msysGit AllUsersStartMenu create an icon in All Users' start menu AllUsersStartMenu2 create an icon in All Users' start menu's Programs>msysGit EnableQuickEdit enable the QuickEdit mode in the console Short options are q, d, s, s2, a and a2.
As an optional step, you could add another cmd file in K:devtoolsmsysGitcmd folder (mine is called bash.cmd), which contains the command used for the msysGit desktop shortcut created before, allowing you to start the shell from any command prompt:
@K:devtoolsmsysGitbinsh.exe --login -i
Free some space
In the /git folder you can clean the compiled binaries, since they were copied in the required locations:
cd /git make clean
Another step would be to strip the binaries from /bin and /libexec/git-core/:
/mingw/bin/strip.exe /bin/*.exe /libexec/git-core/*.exe
All the commands in this section must be typed in a msysGit shell.
Updated html documentation
Since html documentation can’t be build due to missing asciidoc, you must download git-htmldocs-188.8.131.52.tar.gz and unpack the content in the K:devtoolsmsysGitdocgithtml folder, after deleting the previous content.
Git Gui, gitk, TortoiseGit and Git Extensions
In order to use all the clients from both msysGit shell and cmd.exe, you must copy all files and folders from /mingw/lib into /lib, and also from /mingw/bin into /bin.
If you want to use plink.exe for ssh connections, you have to add the private key to pageant, and define an environment variable with the full path of the plink.exe, like:
In case of plink errors, you could try to include the login name in the git URLs, or connect first with putty.exe in order to add the host to the trusted list.
If you want to use git commands inside any command prompt, you need to add the /cmd folder of your msysGit installation to your path, in my case this would be K:devtoolsmsysGitcmd
For branch/diff/status color output, run the following command:
git config --global color.ui auto
and then set two environment variables:
In order to disable the commit line endings transformation, you could run:
git config --global core.autocrlf false