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

[FYI] Using git on msys2 #4651

Closed
mattn opened this issue Mar 24, 2016 · 2 comments
Closed

[FYI] Using git on msys2 #4651

mattn opened this issue Mar 24, 2016 · 2 comments
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@mattn
Copy link

mattn commented Mar 24, 2016

As I filed issue ago, vscode can't work with msys2's git. Because git provided on msys2 return /c/ prefixed-path for rev-parse command.

#387

If you really want to use msys2's git, try following.

  1. Write git-wrap.bat for git.exe

    @echo off
    setlocal
    
    rem If you don't add path for msys2 into %PATH%, enable following line.
    rem set PATH=c:\msys64\usr\bin;%PATH%
    
    if "%1" equ "rev-parse" goto rev_parse
    git %*
    goto :eof
    :rev_parse
    for /f %%1 in ('git %*') do cygpath -w %%1

    Put this git-wrap.bat into somewhere.

  2. Set git.path for git-wrap.bat
    open File -> Preferences -> User Settings, And add git.path pointed git-wrap.bat on your configuration file like below.

      "git.path": "c:/users/mattn/bin/git-wrap.bat",
    
  3. Restart vscode

Have fun!

@Tyriar
Copy link
Member

Tyriar commented Mar 27, 2016

@mattn thanks for figuring this out, you may want to open a self-answered question on Stack Overflow to help other people who search for it.

@jonaskello
Copy link

Thanks @mattn this fixed it for me! Please add to the docs!

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants