Friday, August 7, 2015

Installing gitflow on Windows

This page outlines the installation of the gitflow scripts on the three major distributions of git. Please follow the directions for your git distribution.
For Windows users, msysgit is a good starting place for installing git.

Cygwin

For Windows users who wish to use the automated install, it is suggested that you installCygwin first to install tools like gitutil-linux and wget (with those three being packages that can be selected during installation). Then simply run this command from a Cygwin shell in your $HOME:
$ wget -q -O - --no-check-certificate https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | bash
If you got problem to clone /gitflow-installer.sh with protocol git://, so change the way to clone if protocol git:// is used with this command :

git config --global url."https://".insteadOf git://
Then take a look at your global configuration using :

git config --list
You'll see the following line in the output:
url.https://.insteadof=git://
If you are on a restricted user account, you can switch the installation location with the INSTALL_PREFIX environment variable:
    $ export INSTALL_PREFIX=$USERPROFILE/bin
    # Run wget command above
Of course, the location you install to should be in $PATH
If you get the error "flags: FATAL unable to determine getopt version" error after
$ git flow init
you need to install the util-linux package using the Cygwin setup.
If you get something like "$'\r': command not found" then it's a problem with your line endings. You should run the following:
$  sed -i 's/\n\r/\n/mg' /usr/local/bin/git-flow*
$  sed -i 's/\n\r/\n/mg' /usr/local/bin/gitflow-*
MSysGit
Download and install getopt.exe from the util-linux package into C:\Program Files\Git\bin. (Only getopt.exe, the others util-linux files are not used). Also installlibintl3.dll and libiconv2.dll from the Dependencies packages (libintl and libiconv), into the same directory.
Clone the git-flow sources from GitHub:
$ git clone --recursive git://github.com/nvie/gitflow.git
$ cd gitflow
Run the msysgit-install script from a command-line prompt (you may have to run it with "Full Administrator" rights if you installed msysgit with its installer, and ensure you're running from a Windows command prompt, not MINGW):
C:\gitflow> contrib\msysgit-install.cmd
In Git bash create a symbolic link for git-flow so that you can actually use the $ git flow command from any location.
$ ln -s /C/gitflow/git-flow git-flow
Source : https://github.com/nvie/gitflow/wiki/Windows
Source : http://stackoverflow.com/questions/4891527/git-protocol-blocked-by-company-how-can-i-get-around-that