Skip to content

use git remote get-url so that insteadOf config is respected#22

Open
abridgett wants to merge 1 commit into
github-modules:masterfrom
abridgett:feature/support_insteadof
Open

use git remote get-url so that insteadOf config is respected#22
abridgett wants to merge 1 commit into
github-modules:masterfrom
abridgett:feature/support_insteadof

Conversation

@abridgett

Copy link
Copy Markdown

Thanks for ghwd - a real timesaver.
If you use insteadOf options in your .gitconfig, this means that they will be expanded - in my case from apb:foobar to git@github.com:abridgett/foobar

@zeke

zeke commented Jun 7, 2017

Copy link
Copy Markdown
Collaborator

Thanks for the PR. What are insteadOf options? Can you explain a bit more?

And if it makes sense, can you add some documentation to the readme about how others can take advantage of this feature?

@abridgett

Copy link
Copy Markdown
Author

Sure - I've not pushed any docs as I'm not sure it makes sense (it's a git feature).

The docs are a little light, but I use it for two cases. Firstly to map github urls consistently (i.e. to avoid a mix of https and git+ssh access) - mostly for continuous-integration servers:
https://stackoverflow.com/questions/1722807/git-convert-git-urls-to-http-urls

Second use case is so that you can do things like "git clone ab:reponame" as a shortcut. I have this in my .gitconfig:

[url "git@github.com:abridgett/"]
	insteadOf = "ab:"

Without this patch, it ghwd tries to open "ab:reponame" (which fails), with this patch it is expanded into git@github.com:abirdgett/reponame which ghwd then converts into the right https URL.

@zeke

zeke commented Jun 9, 2017

Copy link
Copy Markdown
Collaborator

Nice. Didn't know about that. Please add docs and I'd be glad to ship it. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants