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

How do you install wslgit? #140

Open
worldofgeese opened this issue Oct 17, 2023 · 4 comments
Open

How do you install wslgit? #140

worldofgeese opened this issue Oct 17, 2023 · 4 comments

Comments

@worldofgeese
Copy link

It isn't clear from the README.

I installed wslgit using scoop install wslgit. I could have also fetched the release binary from GitHub and put it in my Windows PATH (<- this bit was assumed since it isn't stated in the docs).

Whether I've installed it with scoop or manually fetched the binary, at this point I'm told to run install.bat but no matter where I source it, the response from the script is

Create 'git.exe' symlink...
The system cannot find the path specified.
OK.

git.exe is on my PATH and invokable.

I'm sure everything is obvious but the README assumes a lot of knowledge here. I'd appreciate some clarity!

@andy-5
Copy link
Owner

andy-5 commented Oct 19, 2023

Depending on your use case, an installation might not be necessary.

If you just want to use git from the command line, and already have the binary in some directory on your PATH, you can already use it. You may rename wslgit.exe to git.exe so you can just run git … on the command line (otherwise you had to run wslgit ...).

The install.bat script is just required to create a directory structure similar to Git for Windows, so that some tools are able to auto-detect the "installed" Git. If you want/need this, unzip wslgit.zip from the releases page into some directory on your PATH, and run install.bat as administrator from that directory.
I don’t know how this is handled with the scoop distribution, as I do not maintain that myself (I think it only provides wslgit.exe, and not the directory structure, or install.bat).

Your error seems to indicate that the install.bat is not located in a directory structure as found in wslgit.zip, and therefore cannot find the necessary files.

Does this help you?

However, you wrote that git.exe is already invokable, so it seems you can already use it? What is missing, or does not work?

@worldofgeese
Copy link
Author

worldofgeese commented Oct 20, 2023

@andy-5 I'm using Fork's latest WSL build so I need install.bat to run successfully. I pieced together how to get this to work based on other issues. Basically, it's my fault for picking the wslgit binary over the wslgit.zip on the releases page. It's the zipfile that contains the directory structure install.bat expects. That wasn't clear to me.

I scripted this:

# Download wslgit.zip using Invoke-WebRequest
Invoke-WebRequest -Uri "https://github.com/andy-5/wslgit/releases/download/v1.2.0/wslgit.zip" -OutFile "C:\wslgit.zip"

# Extract wslgit.zip to C:\
Expand-Archive -Path "C:\wslgit.zip" -DestinationPath "C:\"

# Add C:\wslgit\cmd to the system PATH
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\wslgit\cmd", "Machine")

# Optionally, if you want to clean up and remove the downloaded zip after extraction:
Remove-Item -Path "C:\wslgit.zip"
C:\wslgit\install.bat

Would you be open to a PR to the README that steps through this setup?

@andy-5
Copy link
Owner

andy-5 commented Oct 20, 2023 via email

@lostpebble
Copy link

Was also quite confused about how to set this up. I see mention of an install.bat file in the Readme- but nothing inside releases but a zip file and an .exe (which I assume the zip file contains). But actually the install.bat is also inside the zip file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants