I ran into a Windows setup/documentation gap while getting git-subrepo working with Git for Windows.
What I found:
- Documentation on the project isn't very Windows friendly - and the current versions are failing. (At least back to 5.4, perhaps earlier?)
lib/git-subrepo.d/bash+.bash is tracked as a symlink, but in my checkout core.symlinks=false, so it checked out as plain text.
- That made the raw
PATH=<repo>\lib approach fail on Windows.
- A
.cmd wrapper alone was not enough to make git subrepo discoverable here.
- A no-extension
git-subrepo wrapper with a shebang did work.
git subrepo upgrade only worked after the wrapper exec'd the real C:/Projects/git-subrepo/lib/git-subrepo script.
git subrepo help still fails because Git for Windows looks for installed docs under its own git-doc tree. I didn't attempt to fix that.
I made a small PowerShell script to ease setup on Windows (see attached file)
win_install.ps1.txt
The script, if placed in the root of the repository is to be invoked with the CWD in the checkout location.
If the script is added to the project, it will make it possible to do:
git clone https://github.com/ingydotnet/git-subrepo C:\Projects\git-subrepo
& C:\Projects\git-subrepo\win_install.ps1
When executed it looks something like this:
PS C:\Projects\git-subrepo> .\win_install.ps1
Added C:\Users\DKfls\.local\bin to the user PATH.
Windows git-subrepo wrapper installed.
Open a fresh PowerShell and verify:
where.exe git-subrepo*
git help -a | Select-String subrepo
git subrepo version
git subrepo upgrade
I'm well aware that this is a workaround, but at least it's better than an nonfunctional project on Windows.
I ran into a Windows setup/documentation gap while getting
git-subrepoworking with Git for Windows.What I found:
lib/git-subrepo.d/bash+.bashis tracked as a symlink, but in my checkoutcore.symlinks=false, so it checked out as plain text.PATH=<repo>\libapproach fail on Windows..cmdwrapper alone was not enough to makegit subrepodiscoverable here.git-subrepowrapper with a shebang did work.git subrepo upgradeonly worked after the wrapperexec'd the realC:/Projects/git-subrepo/lib/git-subreposcript.git subrepo helpstill fails because Git for Windows looks for installed docs under its owngit-doctree. I didn't attempt to fix that.I made a small PowerShell script to ease setup on Windows (see attached file)
win_install.ps1.txt
The script, if placed in the root of the repository is to be invoked with the CWD in the checkout location.
If the script is added to the project, it will make it possible to do:
When executed it looks something like this:
I'm well aware that this is a workaround, but at least it's better than an nonfunctional project on Windows.