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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abridgett
Copy link

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
Copy link
Collaborator

zeke commented Jun 7, 2017

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
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
Copy link
Collaborator

zeke commented Jun 9, 2017

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants