Implement glab repo fork command
Created by: solidnerd
Is your feature request related to a problem? Please describe. As a Go Developer or working with OSS projects a lot. I mostly fork the repository and do the changes and contribute it back. I want to have an easy way of creating a fork and clone it locally
Describe the solution you'd like
A clear and concise description of what you want to happen.
An implementation of glab repo fork
What it does:
- Create a fork for the requested repo via GitLab API
- Do a
git clone
of the forked repository - Add a
git remote add upstream
automatically to the forked repo from the upstream repository.
Describe alternatives you've considered
/
Additional context
Here is an example with gh repo fork
$ gh repo fork profclems/glab
- Forking profclems/glab...
✓ Created fork solidnerd/glab
? Would you like to clone the fork? Yes
Cloning into 'glab'...
remote: Enumerating objects: 465, done.
remote: Counting objects: 100% (465/465), done.
remote: Compressing objects: 100% (271/271), done.
remote: Total 6905 (delta 206), reused 366 (delta 167), pack-reused 6440
Receiving objects: 100% (6905/6905), 20.63 MiB | 11.56 MiB/s, done.
Resolving deltas: 100% (4706/4706), done.
Updating upstream
From https://github.com/profclems/glab
* [new branch] dependabot/go_modules/github.com/xanzy/go-gitlab-0.40.1 -> upstream/dependabot/go_modules/github.com/xanzy/go-gitlab-0.40.1
* [new branch] profclems-patch-1 -> upstream/profclems-patch-1
* [new branch] trunk -> upstream/trunk
✓ Cloned fork