Skip to content

"glab repo fork" should simply add remote if fork already exists

Describe the feature or problem you'd like to solve When I fork a repo with the web UI, or on another computer, I want to quickly add that remote on other computers or clones of the same repo.

Currently if I run glab repo fork in a newly cloned repo that's already forked server-side, I get:

POST https://gitlab.com/api/v4/projects/example/fork: 409 {message: {name: [has already been taken]}, {path: [has already been taken]}}

Propose a Solution It would be great if glab repo fork simply adds the already-forked remote.

Additional context This is how https://github.com/github/hub tool works - if I run hub fork and the fork already exists in github.com, it simply adds the fork as a new remote without error.

Edited by Kai Armstrong
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information