- run
git fetch
- run
git checkout -t origin/branch-name
- create a remote repo with the same name
- run
git remote add origin git@github.com/gitlab.com:username/repo-name.git
- remember to fill both
username
andrepo-name
, and to delete github or gitlab accordingly. - run
git push --set-upstream origin main
- run
git branch -d branch-name
to delete the branch locally - run
git fetch --prune
to delete the reference to the remote branch
- run
git checkout -b branch-name
- run
git push -u origin branch-name