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

FR: Automatically add upstream remote to forked repository #5928

Open
calebdw opened this issue Mar 8, 2025 · 4 comments
Open

FR: Automatically add upstream remote to forked repository #5928

calebdw opened this issue Mar 8, 2025 · 4 comments

Comments

@calebdw
Copy link
Member

calebdw commented Mar 8, 2025

Hello!

Is your feature request related to a problem? Please describe.
I get tired of manually adding the upstream remote for my forked repositories.

Describe the solution you'd like
It would be nice if jj could be configured to automatically detect this via the api (e.g., github/gitlab/etc) and register the remote (the name could be configurable but could default to upstream).

Describe alternatives you've considered
I have a bash script I used to execute when using git. I could adapt this script to jj, but given that configuring the upstream remote is pretty common I think it would be great to add support natively.

Thanks!

@martinvonz
Copy link
Member

When do you imagine this would happen?

@calebdw
Copy link
Member Author

calebdw commented Mar 8, 2025

Probably right after cloning a new repo, but I suppose there might could also be a remote discover command or something that could be executed on existing repos

@ilyagr
Copy link
Contributor

ilyagr commented Mar 8, 2025

The github CLI has a gh repo clone command that does that. So, if you are OK with co-located repos, you could do that, and then jj git init --colocated.

An alternative to adding this all to jj would be to fork gh to make it work nicer with jj. I'm not sure we are at the point where they would accept patches for this, but maybe?

(But adding it to jj itself might make sense too, I don't mean to reject that idea. Unfortunately, gh is written in Go, not Rust, so it's not trivial to just link it to jj; we'd have to call the CLI or use the same JSON apis and reimplement gh)

@PhilipMetzger
Copy link
Contributor

I don't like the idea of fetching this information until something jj gitlab/github/gerrit exists.

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

4 participants