5

I am trying to get gitflow running on Windows using the instructions here: https://github.com/nvie/gitflow (I am using Windows Server 2003 SP2 64 bit)

I have tried both Cygwin and msysgit.

With Cygwin, calling wget just returns nothing.

With msysgit I get quite a bit further, but when I try and run git flow init I get the following error:

C:\Program Files (x86)\Git/libexec/git-core/git-flow: line 45: dirname: command not found
C:\Program Files (x86)\Git/libexec/git-core/git-flow: line 68: /gitflow-common: No such file or directory
C:\Program Files (x86)\Git/libexec/git-core/git-flow: line 76: /gitflow-shFlags: No such file or directory

Looking at the first error in the git-flow bash file, line 45 contains:

export GITFLOW_DIR=$(dirname "$0")

I've also tried following the steps here https://github.com/nvie/gitflow/issues/issue/25?authenticity_token=54d6387519b4751c2fb13840c52bb819dee10af4 but it doesn't make any difference.

Any ideas?

Thanks

Cascabel
  • 479,068
  • 72
  • 370
  • 318
DownChapel
  • 1,384
  • 1
  • 16
  • 31
  • The `-q` option turns off `wget`'s output, so if you're following those instructions I wouldn't expect it to show anything, just silently fetch the file. Try it without that to see if it's succeeding and you didn't realize it, or if there's an error. – Cascabel Jan 11 '11 at 19:12
  • Thanks after removing -q I could see I was getting a certificate error. – DownChapel Jan 12 '11 at 09:44

4 Answers4

5

This is how I got it to work in Windows:

  1. Install msysgit: http://code.google.com/p/msysgit/
  2. Follow the install instructions in the gitflow readme: https://github.com/nvie/gitflow
  3. Download "git-flow-completion": https://github.com/bobthecow/git-flow-completion
    • Copy "git-flow-completion.bash" from the git-flow-completion zip file to C:\Program Files (x86)\Git\etc
    • Create a new file called "bash_profile" (no extension) in C:\Program Files (x86)\Git\etc and add this one line:
      source "c:\Program Files (x86)\Git\etc\git-flow-completion.bash"
Trev
  • 1,358
  • 3
  • 16
  • 28
  • In case anyone else gets the same issue I had, I had to manually download (or clone via Git) the [shFlags](https://github.com/nvie/shFlags) content into the root of the cloned GitFlow folder, so that running the command file performed all file copying correctly. – Samuel Slade Oct 21 '13 at 10:51
1

For the msysgit installation, I'm not sure where dirname would normally come from (I'm not a windows guy). It's possible it's included in that util-linux package that is mentioned in the gitflow installation instructions. It's also possible your PATH is borked - have a look in the usual places (/bin, /usr/bin, /usr/local/bin) and see if dirname is in any of them, and see if your PATH is missing that one. Failing all that, dirname $0 is simply the name of the directory containing that script, so it's possible that you could simply hardcode that and proceed.

Edit:

Aha. According to this question, the wget certificate error is a known issue, not specific to github. It's been fixed in wget, but the fix hasn't been released yet in debian/ubuntu, and I'm not sure how long it'll take to work its way through to cygwin. You can work around it as mentioned in the linked question, though. But of course, I think it's probably much better to use msysgit than cygwin git, from what I've heard.

Community
  • 1
  • 1
Cascabel
  • 479,068
  • 72
  • 370
  • 318
  • 1
    Thanks, in the end I changed the script to have the directory name hardcoded. – DownChapel Jan 12 '11 at 09:35
  • I have edited msysgit-install.cmd and find this: xcopy "%~dp0\..\shFlags\src\shflags" changing this path or creating this folders structure and putting gitflow-shflags file into it is a solution. – user1011138 Oct 16 '13 at 06:49
1

The problem lies in the path returned by the "export GITFLOW_DIR=$(dirname "$0")".

Solution: https://github.com/nvie/gitflow/pull/161

HCN
  • 11
  • 2
0

I had this problem happening with my machine was that the git flow install was adding the flow files to the

C:\Program Files (x86)\Git\libexec\git-core  

but the git flow init was looking for them in the

C:\Program Files (x86)\Git\libexec\

so I just copied and pasted them in:

C:\Program Files (x86)\Git\libexec\

Now it works!

Natdrip
  • 1,144
  • 1
  • 11
  • 25