First, you fetch not be should be git fetch other
but.
cd /path/to/repo2
git remote add repo1 https://...repo1.git
git fetch repo1
In other words, you would work in a local clone of the target repo (repo2), not in repo1.
Second, it should list all branches, with git branch -avv
.
However, since repo1 and 2 have no common history, it would be up to you to determine the start of a repo1 branch (or it would consider the branch commits all the way back to the first repo1 commit: there is no common branch from which said branch has started in repo1)
If you think a repo1 branch can be applied to an existing repo2 history, you can:
- create a new branch branch from
repo1/aBranchToMove
rebase --onto
the repo1 branch (on)to an existing repo2 branch
That is:
cd /path/to/repo2
git switch -c newBranch repo1/branch
git rebase --onto main <first-Commit>~ newBranch
That will relocate commits, from <first-Commit>
(that you need to lookup in repo1) up to newBranch (which references the repo1 branch HEAD, that you want to cherry-pick) onto an existing repo2 branch (here 'main
' for instance)