Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git.path from windows native bash #32044

Closed
andre2 opened this issue Aug 4, 2017 · 1 comment
Closed

Git.path from windows native bash #32044

andre2 opened this issue Aug 4, 2017 · 1 comment
Assignees
Labels
git GIT issues

Comments

@andre2
Copy link

andre2 commented Aug 4, 2017

This is my vscode config:

{
    "terminal.external.windowsExec": "C:\\Windows\\System32\\bash.exe",
    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\bash.exe",
    "git.path": "C:\\Users\\Me\\Documents\\Scripts\\git.bat"
}

windowsExec and windows works good but git.path dont work.. How i use windows native bash for vscode git.path?

And vscode git logs response:

git rev-parse --show-toplevel
git rev-parse --show-toplevel
git status -z -u
git status -z -u

My bat script:

@echo off
C:\Windows\System32\bash.exe -c "git %*"

On refresh response alert:

Git: spawn C:\Users\Me\Documents\Scripts\git.bat ENOENT

Also i try with make better bat script, here is source:

@echo off

set _path=%cd%
set _path=%_path:"=%
set drive=%_path:~0,1%
set _path=%_path:~2%
set _path=%_path:\=/%

if %drive%==A set "drive=a"
if %drive%==B set "drive=b"
if %drive%==C set "drive=c"
if %drive%==D set "drive=d"
if %drive%==E set "drive=e"
if %drive%==F set "drive=f"
if %drive%==G set "drive=g"
if %drive%==H set "drive=h"
if %drive%==I set "drive=i"
if %drive%==J set "drive=j"
if %drive%==K set "drive=k"
if %drive%==L set "drive=l"
if %drive%==M set "drive=m"
if %drive%==N set "drive=n"
if %drive%==O set "drive=o"
if %drive%==P set "drive=p"
if %drive%==Q set "drive=q"
if %drive%==R set "drive=r"
if %drive%==S set "drive=s"
if %drive%==T set "drive=t"
if %drive%==U set "drive=u"
if %drive%==V set "drive=v"
if %drive%==W set "drive=w"
if %drive%==X set "drive=x"
if %drive%==Y set "drive=y"
if %drive%==Z set "drive=z"

set dir="/mnt/%drive%%_path%"

C:\Windows\System32\bash.exe -c "git %* --git-dir=%dir%"

And vscode terminal try to open git /mnt/d/Program Files/Microsoft VS Code directory, response:

Using git "/mnt/d/Program Files/Microsoft VS Code"
git version 2.7.4 from C:\Users\Me\Documents\Scripts\git.bat
git rev-parse --show-toplevel
git rev-parse --show-toplevel
git status -z -u
git fetch
git config --get commit.template
git show :c:/Users/Me/Documents/Scripts/git.bat

But this won't work :/ Is any other solution to add bash as git?
How to fix it and run it with native windows ubuntu bash? Thanks!

@vscodebot vscodebot bot added the git GIT issues label Aug 4, 2017
@joaomoreno
Copy link
Member

#9502

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
git GIT issues
Projects
None yet
Development

No branches or pull requests

2 participants