Thursday, February 4, 2021

GitLab - Fork using CLI

 

Fork using CLI:

  1. Clone our own project repo to local:  git clone https://gitlab.com/XXX.git
  2. Add upstream repo: git remote add upstream https://gitlab.com/XXXX
  3. To verify the remote has been added: git remote -v
  4. Pull changes from upstream to local: git pull upstream master
  5. Push to origin (Fork: our own repo): git push origin master
Reference : https://www.sitepoint.com/quick-tip-synch-a-github-fork-via-the-command-line/


But it is only click the 'Fork' button that you can create merge request to the upstream repo. So better use CLI only to sync with the upstream repo.

No comments:

Post a Comment