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

gitconfig ghq by host isn't working #389

Open
cdenneen opened this issue Jun 7, 2024 · 0 comments
Open

gitconfig ghq by host isn't working #389

cdenneen opened this issue Jun 7, 2024 · 0 comments

Comments

@cdenneen
Copy link

cdenneen commented Jun 7, 2024

[ghq]
  root = ~/.ghq

[ghq "github.com"]
  vcs = git
  root = ~/src/github.com

[ghq "gitlab.com"]
  vcs = gitlab
  root = ~/src/gitlab

[ghq "git.company.com"]
  vcs = gitlab
  root = ~/src/corp

Then

❯ ghq get [email protected]:group/path/repo                                                                                                                                                                                                                            
    exists /Users/cdenneen/.ghq/git.company.com/group/path/repo

if I understand the config properly this should have been cloned into /Users/cdenneen/src/corp/group/path/repo??

Honestly my reason for different roots is to not have to add the full "hostname" to the path but rather an alias for that hostname (shortens the directory structure).

So I would like something like:

[ghq]
  root = ~/.ghq

[ghq "github.com"]
  vcs = git
  root = ~/src/gh

[ghq "gitlab.com"]
  vcs = gitlab
  root = ~/src/gl

[ghq "git.company.com"]
  vcs = gitlab
  root = ~/src/corp

to clone this repo for example with:

ghq [email protected]:x-motemen/ghq to /Users/cdenneen/src/gh/x-motemen/ghq.

I've tried to move the [ghq] catchall to the bottom of the .gitconfig but it doesn't matter, still cloning something for that domain into the catchall root.

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

1 participant