[go: up one dir, main page]

Skip to content

Fetch after earlier fork

Problem to solve

When I fork a repository, I get up-to-date clone. I make a branch with a few commits and send a merge request. Everything is fine so far.

A month later, I want to make another change. I go to the upstream repo, click "fork", and I get my long-ago forked repo which is now obsolete and many commits behind. Ouch.

Proposal

Please add "Fetch" (or "Pull") button to update earlier cloned repository from upstream. It should behave just like git fetch. The result should be the same as if I just forked the repo again (keeping my changes, of course). A simple brief preview may be useful. It may be reasonable to fetch only tags and master (default) branch by default.

Use Case

  1. Fork (clone) a repository via Gitlab web UI (the Fork button)
  2. Create a feature branch in the forked repository, develop a feature
  3. Someone updates upstream (original) repository
  4. I want to update the forked repository. How can I do it? I'm too lazy to configure local repository with upstream remote repository.
  5. [new feature] Hit "Fetch" button. Gitlab runs git fetch in the clone on the server. New upstream commits appear in my forked repository.
  6. I run git fetch in local repository to get the new commits too.

Future improvements

  • Fetch upstream changes automatically.
  • Fetch selected subset of branches and tags. We can start with two options: "Everything", and "Default branch and tags only".
  • Resolve conflicts on pull. We can start with a simple failure when Fast Forward pull is not possible.
  • Rebase.
Edited by 🤖 GitLab Bot 🤖