I have tried to make a fork of a github repo in an internal gitlab server by making an empty repo on GitLab, cloning it, and doing
git remote add upstream https://github.com/user/repo
git pull upstream master
git push origin main
This worked and I have the files and history of the master branch of the github repo. git branch -r now shows origin/main and upstream/master.
However, when I clone the repository for a second time there is no upstream/master shown by git branch -r.
If I need to pull new commits from upstream/master and then apply them to my repo, do I just need to re-add the remote, pull from it, and then rebase my changes? Is there any way to have the remotes included when I clone the repo?
Thanks