Skip to content

Enable customizing the host folder name#425

Open
tejassharma96 wants to merge 3 commits intox-motemen:masterfrom
tejassharma96:master
Open

Enable customizing the host folder name#425
tejassharma96 wants to merge 3 commits intox-motemen:masterfrom
tejassharma96:master

Conversation

@tejassharma96
Copy link

Allows for customization using .gitconfig of the folder under root that is used to checkout repositories (instead of the git remote hostname).

So eg if I had

[ghq]
root = ~/repos

[ghq "https://github.com"]
hostFolderName = "gh"

when I run ghq get https://github.com/x-motemen/ghq.git, it would be cloned to ~/repos/gh/x-motemen/ghq

@Songmu
Copy link
Member

Songmu commented Feb 1, 2026

Thank you for your pull request.

Since ghq is a tool designed to enforce directory names according to specific conventions, I do not intend to introduce flexible configurations for that purpose.

If your requirement is to separate clone locations for each organization, you can use the ghq.<url>.root setting, so please consider using that instead.

@Ramblurr
Copy link

Ramblurr commented Feb 4, 2026

If your requirement is to separate clone locations for each organization, you can use the ghq.<url>.root setting, so please consider using that instead.

I tried this with:

[ghq "https://github.com"]
        root = "~/src/gh"

Then ran it with ghq get https://github.com/x-motemen/ghq

The result was that it cloned the repo to ~/src/gh/github.com/x-motemen/ghq, whereas I expected ~/src/gh/x-motemen/ghq`.

Is that correct from you point of view?

@Songmu
Copy link
Member

Songmu commented Feb 13, 2026

This behavior is by design. While the directory structure created by ghq can indeed become deep and long, which might feel cumbersome, I believe it is convenient for managing many cloned repositories and has the benefit of being opinionated. Furthermore, navigating between directories is not an issue when combined with filtering tools, so I don't believe there is a need for the flexibility to make this configurable.

@tejassharma96
Copy link
Author

hmmm, ok. I disagree that allowing customization of the folder path from github.com to gh or codeberg.org to cb goes against the opinionated folder structure (and I really like the opinionated folder structure!), I actually think it aligns quite well with the existing customization options you provide. But at the end of the day I'm not a maintainer here so I guess I'll just have to keep my fork around indefinitely 😞

I'll keep the PR open in case you change your mind, I'd really love to see this merged but if you're absolutely set on not allowing this customization you can go ahead and close 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.

3 participants