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

Git clone should be able to respect insteadOf configuration #109

Closed
thefotios opened this issue Oct 29, 2018 · 2 comments
Closed

Git clone should be able to respect insteadOf configuration #109

thefotios opened this issue Oct 29, 2018 · 2 comments

Comments

@thefotios
Copy link

I'm currently using insteadOf to alias my company's gitlab instance and force SSH like this:

[url "git@gitlab.mycompany:"]
        insteadOf = gl:
        insteadOf = ssh://gl/
        insteadOf = https://gl/

This mostly works when using ghq, except that the directory name is created before running git ls-remote.

Actual/Expected output shown in the diff below:

$ ghq get gl:foo/bar
clone ssh://gl/foo/bar -> /Users/fotios/src/gl/foo/bar
git clone ssh://gl/foo/bar /Users/fotios/src/gl/foo/bar
- Cloning into '/Users/fotios/src/gl/foo/bar'
+ Cloning into '/Users/fotios/src/gitlab.mycompany/foo/bar' 

This can also be used instead to augment specifying -p since insteadOf can be used to force HTTPS/SSH depending on the path.

@Songmu
Copy link
Member

Songmu commented Apr 28, 2019

I see it is the reverse lookup function. It is considerable feature but, In any case, I think that it should not be the default behavior.

@Songmu
Copy link
Member

Songmu commented Dec 21, 2019

The feature of ghq is that it is easily cloned to the directory corresponding to the argument, so I think that the function of switching the clone destination by looking at the "insteadOf" is unnecessary.

@Songmu Songmu closed this as completed Dec 21, 2019
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

2 participants