Open xinde opened 7 years ago
I get the same error.
Linux Mint vs code 1.8.1 git 2.11.0
I get the same error.
I'm unable to reproduce the issue on my local systems, could I see some of the console output from the developer console when you try to run the failing commands?
Hi @vector-of-bool
I can see this message with the command > Gitflow: Initialize repository for gitflow
[Extension Host] [gitflow] Execute git config --get gitflow.branch.master
[Extension Host] [gitflow] Command "git" returned code -4058:
spawn git ENOENT: Error: spawn git ENOENT
at exports._errnoException (util.js:1026:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
WARNING: Promise with no error callback:94
Object {exception: null, error: Error: spawn git ENOENT
at exports._errnoException (util.js:1026:11)
at Process.ChildProcess…, promise: n.C…s.d…e._oncancel, handler: undefined, id: 94…}
spawn git ENOENT
I would believe, this error comes, because git is not in the path.
I had a look in the vscode discovery for the git config. They are using the @IGitService to access the internal git, which automatically detects the os specific git installation
Hi @d-schiffner
Git works in VS Code.
I have only the GitHub Desktop app and their shell.
In the PATH it's not ready.
Hi @ajsb85,
yes, VS Code searches internally for the correct path and then uses it. However, this plugin does not use the available service but instead calls git via shell, which is not defined.
Not tested workaround: Add git to path
@d-schiffner, thanks for the tips! I wasn't aware VSCode did that to find git. That should be helpful in fixing this problem now that I have a lead on what it actually going on.
Hi @vector-of-bool so just use vscode.workspace.getConfiguration("git").get("path", "git")
instead of "git"
This only works, if you have defined a path there, or fall back to the normal assumption, that git is available from the path.
Git is in my path on linux, but I still get the error.
My debug console output is different, however:
[gitflow] Execute git config --get gitflow.branch.master
[gitflow] Command "git" returned code 1:
[gitflow] Execute git config --get gitflow.branch.develop
[gitflow] Command "git" returned code 1:
[gitflow] Execute git rev-parse --quiet --verify HEAD
[gitflow] Command "git" returned code 1:
[gitflow] Execute git symbolic-ref HEAD refs/head/master
[gitflow] Command "git" returned code 0:
[gitflow] Execute git commit --allow-empty --quiet -m Initial commit
[gitflow] Command "git" returned code 0:
[gitflow] Execute git branch --no-color
[gitflow] Command "git" returned code 128: fatal: HEAD not found below refs/heads!
[gitflow] Execute git branch -r --no-color
[gitflow] Command "git" returned code 128: fatal: HEAD not found below refs/heads!
[gitflow] Execute git branch --no-color
[gitflow] Command "git" returned code 128: fatal: HEAD not found below refs/heads!
[gitflow] Execute git branch -r --no-color
[gitflow] Command "git" returned code 128: fatal: HEAD not found below refs/heads!
[gitflow] Execute git branch --no-track develop master
[gitflow] Execute git checkout develop
[gitflow] Command "git" returned code 128: fatal: HEAD not found below refs/heads!
[gitflow] Command "git" returned code 1: error: pathspec 'develop' did not match any file(s) known to git.
So it turns out that my error is caused because I was using a newly initialized repository without any commits. The git rev-parse --quiet --verify HEAD
returned nothing causing git symbolic-ref HEAD refs/head/master
to be executed. Unfortunately, refs/head/master
is not a valid link. The path head
should be heads
.
The invalid HEAD state causes the rest of the script to fail and the extension return code to be 1.
The typo is in line 121.
Thanks, @d-schiffner, for the awesome PR. I've just pushed out the changes, and, hopefully, this will fix the problems with Git.
@vector-of-bool: You're welcome. Keep up the good work ;)
Hello I seem to still be experiencing this problem and suggestions on how I can fix it?
@jonathanfishbein1 are you starting with a repository that doesn't have any commits? If so, there is a bug that is not fixed by the latest release.
After the changes in the new version of TypeScript you need to review in deep this extension @vector-of-bool
I have created a pull request to fix the typo in the symbolic-ref:
https://github.com/vector-of-bool/vscode-gitflow/pull/12
This bug will also cause the error where git will return 1.
Is any still experiencing this exact issue?
Still experiencing here. Latest OSX and VS Code. Tried in both newly initialized git projects (with and w/o commits), and in existing projects. No luck. VSCode doesn't appear to have any other problems accessing git. Git is in path.
You will continue to get this error until the next release or you can clone the latest code and build it yourself.
Anyone still experiencing this issue in the latest version?
I just installed the extension on vscode for Mac and got this error after running "initialize repository for gitflow"
I also got the same error on VS Code for Mac. All other git functions work as expected.
I just installed the extension on vscode for Mac and got this error after running "initialize repository for gitflow"
yes, same error.
This issue is still opened so I put it here. I faced the same problem when I created a new project, the solution I found is create the develop branch manually and initialize git flow command worked for me. I hope it will work for people facing the same problem.
this is bcs you haven't had master and develop as branch in your local
when I select 'Initialize repository for gitflow' ,at last step,an error occurred
error: "git" returned status 1
windows 10 vs code 1.8.1