Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Git for Windows paths are different in 2.x releases #210

Closed
nic-gibson opened this issue Jun 30, 2015 · 15 comments
Closed

Git for Windows paths are different in 2.x releases #210

nic-gibson opened this issue Jun 30, 2015 · 15 comments

Comments

@nic-gibson
Copy link

The msysgit-install.cmd doesn't copy files to the correct location when git for windows 2.x is installed because the .../bin/ directory is not on the path. The files need to be moved to .../usr/bin/ after installation. Perhaps the script could check for the presence of /usr/bin and install there. Happy to submit a patch if you want but I'm not exactly a skilled windows user.

@viniciussalvati
Copy link

This seems a little more complex than that.
Git v2.x seems to use both the /cmd and the /usr/bin. If I move git-flow-* and getopt.exe files i either of those folder, it "works". Git flow commands are understood.

However, this is what happened when I tried to run git-flow

$ git flow feature                                                                                                                   
C:/Program Files/Git/cmd/gitflow-shFlags: line 149: _flags_fatal: command not found                                                  
C:/Program Files/Git/cmd/gitflow-shFlags: line 264: [: too many arguments                                                            
C:/Program Files/Git/cmd/gitflow-shFlags: line 264: [: too many arguments                                                            
C:/Program Files/Git/cmd/gitflow-shFlags: line 264: [: too many arguments                                                            
C:/Program Files/Git/cmd/gitflow-shFlags: line 1013: [: -ne: unary operator expected                                                 
flags:WARN                                                                                                                           
flags:FATAL unable to parse provided options with getopt.

This seems to happen for every command that tries to read the values from the git config (that's where I assume it stored my branches naming configuration).

Though I'm not an expert, I think I could fix the msysgit-install.cmd script, but I don't know what to do to make git-flow work.

@bill-bradley
Copy link

As a workaround, if you install the 32 bit version of git 2.5 instead of the 64 bit. And then run:
msysgit-install.cmd 'C:\Program Files (x86)\Git\usr', you should avoid the above errors.

@petervanderdoes
Copy link
Owner

I'll see what I can do. Git for Windows moved to msys2, I need to install the portable version to see what I can do to fix this.

@gabrielpeixoto
Copy link

I am using git on version 1.9.5.

Any news?

@viniciussalvati
Copy link

I guess everyone forgot about this issue. I got it working for a while now.

I'm using git version 2.7.0.windows.1, but it was working with earlier versions.

All I did was get the latest commits of this repository, navigated to the contrib folder and ran the command (I used powershell, but I think you can use anything) :

.\msysgit-install.cmd "C:\Program Files\Git\usr"

The only difference in the command I ran and the command .\msysgit-install.cmd
suggests me if I don't specify a path, is that I added a \usr at the end of the path.

And the getopt.exe file must be in the folder C:\Program Files\Git\usr\bin for 64 bits versions of GIT. I assume it must be in the folder C:\Program Files (x86)\Git\usr\bin for 32 bits versions

@HaveF
Copy link

HaveF commented Jan 12, 2016

@viniciusmelquiades but the error is still there...

/r/test$ git-flow init -h
/mingw64/bin/gitflow-shFlags: line 149: _flags_fatal: command not found
/mingw64/bin/gitflow-shFlags: line 264: [: too many arguments
/mingw64/bin/gitflow-shFlags: line 264: [: too many arguments
/mingw64/bin/gitflow-shFlags: line 264: [: too many arguments
/mingw64/bin/gitflow-shFlags: line 264: [: too many arguments
/mingw64/bin/gitflow-shFlags: line 264: [: too many arguments
/mingw64/bin/gitflow-shFlags: line 264: [: too many arguments
/mingw64/bin/gitflow-shFlags: line 264: [: too many arguments
/mingw64/bin/gitflow-shFlags: line 264: [: too many arguments
/mingw64/bin/gitflow-shFlags: line 1013: [: -ne: unary operator expected
flags:WARN
flags:FATAL unable to parse provided options with getopt.

@HaveF
Copy link

HaveF commented Jan 12, 2016

after delete the gitflow things under C:/Program Files/Git/mingw64/bin/, the error is still there:

/r/test$ git flow init -h
C:/Program Files/Git/usr/bin/gitflow-shFlags: line 149: _flags_fatal: command not found
C:/Program Files/Git/usr/bin/gitflow-shFlags: line 264: [: too many arguments
C:/Program Files/Git/usr/bin/gitflow-shFlags: line 264: [: too many arguments
C:/Program Files/Git/usr/bin/gitflow-shFlags: line 264: [: too many arguments
C:/Program Files/Git/usr/bin/gitflow-shFlags: line 264: [: too many arguments
C:/Program Files/Git/usr/bin/gitflow-shFlags: line 264: [: too many arguments
C:/Program Files/Git/usr/bin/gitflow-shFlags: line 264: [: too many arguments
C:/Program Files/Git/usr/bin/gitflow-shFlags: line 264: [: too many arguments
C:/Program Files/Git/usr/bin/gitflow-shFlags: line 264: [: too many arguments
C:/Program Files/Git/usr/bin/gitflow-shFlags: line 1013: [: -ne: unary operator expected
flags:WARN
flags:FATAL unable to parse provided options with getopt.

@viniciussalvati
Copy link

what's your git installation path, git version, and command you're running?

@HaveF
Copy link

HaveF commented Jan 12, 2016

/r/test$ git --version
git version 2.6.3.windows.1

installed at C:/Program Files/Git/
reinstall with your command .\msysgit-install.cmd "C:\Program Files\Git\usr"

@viniciussalvati
Copy link

know you got me. If I did something else for mine to work, I don't remember.

What version of gitflow are you using? I did a git pull on this repository today just to test this. I'm using the master branch

@HaveF
Copy link

HaveF commented Jan 13, 2016

I'm using the newest develop branch.
So, do all your git-flow commands work fine?
Feel headache about the shell script, or just leave it now....

@viniciussalvati
Copy link

@HaveF that's right. they just work.
I used to get the same errors you're getting right after I updated to git 2.0 (thanks to Chocolatey for changing to the 64 bit version without notifying me).

Thinking about it, it could be the getopt.exe I'm using. It's just a guess, but it is mentioned in your error message. I don't remember if I used the one provided on git-flow's wiki or if I downloaded some other version. I can send you the one I'm using if you want to try it out.

@HaveF
Copy link

HaveF commented Jan 13, 2016

@viniciusmelquiades thanks! depends on your comments, I tried getopt.exe (the version list in https://github.com/nvie/gitflow/wiki/Windows ), it works now. thanks again!

@viniciussalvati
Copy link

@HaveF I'm glad it worked.

@petervanderdoes Perhaps you can find someone with git for Windows 32 bits and if they're not having trouble I think you can close the issue.

@linquize
Copy link

You need to support 3 types of path: git 1.9.5, git 2.x 32-bit, git 2.x 64-bit

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants