Want to download another remote branch to make maintenace, then push back.
so I tried:
git switch another_branch
fatal: invalid reference: another_branch
tried:
git checkout --track origin/another_branch
fatal: 'origin/another_branch' is not a commit and a branch 'another_branch' cannot be created from it
tried:
git checkout another_branch
error: pathspec 'another_branch' did not match any file(s) known to git
tried:
git fetch origin another_branch:another_branch
From gitlab.my-inc.com:projname/proj
* [new branch] another_branch -> another_branch
git checkout another_branch
Switched to branch 'another_branch'
seems good but:
git pull
fatal: refusing to merge unrelated histories
git branch -vv
* another_branch 421f45e normal commit comments
git branch --set-upstream-to origin/another_branch
error: the requested upstream branch 'origin/another_branch' does not exist
hint:
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.
so, I tried:
git fetch
git fetch origin another_branch
From gitlab.my-inc.com:projname/proj
* branch another_branch -> FETCH_HEAD
and still got:
git branch --set-upstream-to origin/another_branch
error: the requested upstream branch 'origin/another_branch' does not exist
hint:
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.
Now I feel totally not human seeing others playing well with their git...
So please help, and thanks in advance.