Gitflow Installation Problems
I am trying to get gitflow running on Windows using the instructions here: https://github.com/nvie/gitflow (I am us开发者_StackOverflow中文版ing 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
This is how I got it to work in Windows:
- Install msysgit: http://code.google.com/p/msysgit/
- Follow the install instructions in the gitflow readme: https://github.com/nvie/gitflow
- 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"
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.
The problem lies in the path returned by the "export GITFLOW_DIR=$(dirname "$0")".
Solution: https://github.com/nvie/gitflow/pull/161
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!
精彩评论