-
Notifications
You must be signed in to change notification settings - Fork 240
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
Retrieving a single file from a git repo? #98
Comments
It didn't work for me either, but there's a workaround in a case where your source is GitHub:
Or omitting
|
I'm curious, is there a technical limitation that is preventing this? |
I found that you can use The downside of this is $ go-getter -mode=file git@github.com:hashicorp/go-getter.git/README.md test/README.md
2021/07/11 15:42:56 success!
$ file test/README.md
test/README.md: ASCII text, with very long lines Subdirectory... $ go-getter -mode=file git@github.com:hashicorp/go-getter.git/helper/url/url.go test/url.go
2021/07/11 15:44:56 Error downloading: /usr/local/bin/git exited with 128: Cloning into '/var/folders/hw/6rsc6cbj5nddyhgfbwpdc5z80000gn/T/getter238570144/temp'...
fatal: remote error:
hashicorp/go-getter.git/helper/url is not a valid repository name
Visit https://support.github.com/ for help
# let's try with the subdirectory syntax
$ go-getter -mode=file git@github.com:hashicorp/go-getter.git//helper/url/url.go test/url.go
2021/07/11 15:45:05 Error downloading: /usr/local/bin/git exited with 128: Cloning into '/var/folders/hw/6rsc6cbj5nddyhgfbwpdc5z80000gn/T/getter520566758/temp'...
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists. Hope this helps |
Created a fork that fixes this issue at arikkfir/go-getter (see branches |
I've run into this issue and was curious if we can expect fix being merged upstream at some point. The only difference is that this issue isnt isolated to the github getter for us. |
For anyone who needs a stable release that incorporates this, I've created releases in my fork arikkfir/go-getter, based on the current releases The release notes include instructions on how to use them (single-liner to your For the |
Any news? |
Is go-getter able to retrieve a single file from a git repo? It appears to work fine when the source is a directory, but not when the source is a file.
It does create the target directory, but does not write the file.
Also tried specifying the destination as a filename, but that just creates a directory named for the file:
The text was updated successfully, but these errors were encountered: