How to fix this GitFlow error

Sócrates Medina January 21, 2017

I just installed sourcetree on a new PC and I have cloned my Repository, but when I try to use the GitFlow button I am getting this error:

sh.exe "C:\Users\MyUserName\AppData\Local\Atlassian\SourceTree\gitflow_local\gitflow\git-flow" init -d
/usr/bin/sh: "C:\Users\MyUserName\AppData\Local\Atlassian\SourceTree\gitflow_local\gitflow\git-flow": No such file or directory
Completed with errors, see above.

 

Any Idea how to fix this?

5 answers

1 vote
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2017

I see, the special character is in your Username. That could definitely be the problem. Git runs in a MinGW terminal, which is a linux emulator, and it may handle special characters like that differently than its windows environment. You might install your own copy of Git in another folder (C:\Program Files or something), and set SourceTree to use System Git instead.

Sócrates Medina January 24, 2017

I am going to try that but I think I already did and it kept looking for the git on the users folder

0 votes
Kenneth Österberg August 16, 2019

I had the same problem, with a "Ö"-character in the folder in "Users" that caused a "No such file or directory" error from sh.exe when executing git-flow.

I used Windows Process Monitor (https://docs.microsoft.com/en-us/sysinternals/downloads/procmon), filtering events by a rule "Process Name contains sh.exe" to find where sh.exe is looking for git-flow.

I found that it's looking under my git folder C:\git\projname, appending the full path to git-flow under it, but using some invalid characters in the path:

C:\git\projname\C\Users\Kenneth Österberg\AppData\Local\Atlassian\SourceTree\gitflow_local\git-flow

I created the folder structure under my git folder, and added the folder to my ".gitignore" file like:

/C/Users/Kenneth Österberg/AppData/Local/Atlassian/SourceTree/gitflow_local/gitflow

I copied the files from C:\Users\Kenneth Österberg\AppData\Local\Atlassian\SourceTree\gitflow_local\gitflow to the folder structure.

After this I was able to use Git Flow from the SourceTree GUI.

0 votes
Sócrates Medina January 23, 2017

When I try to clone my repository I get this error:

Checking out files: 100% (1855/1855), done.
/usr/bin/sh: "C:\Users\Sócrates Medina\AppData\Local\Atlassian\SourceTree\git_local\mingw32/libexec/git-core\git-submodule": No such file or directory
fatal: 'submodule' appears to be a git command, but we were not
able to execute it. Maybe git-submodule is broken?

Completed with errors, see above.

0 votes
Sócrates Medina January 23, 2017

I am using embedded Git, My user folder is called "Sócrates Medina" I don't know if the special character may be causing the problem.

If I browse to that folder I can see all the files there.

Any ideas?

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 23, 2017

Are you using embedded or system git?

Tools > Options > Git - look in the Git Version box.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events