It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to fix this GitFlow error

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

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.

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

Are you using embedded or system git?

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

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?

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.

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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,942 views 0 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you