Here are the commands:
1) git checkout [branch name A] - "Checkout to the branch that you want to push/copy files from"
2) git remote add new [remote_repository] - "Add your new repo where you want to keep this branch/branch files"
If new remote already exist, change the new using below command
3) git remote set-url new [new remote URL]
4) git push new [branch name A] - "Push this branch to the new repo"
Repeat the above command for use case 2 and continue with the below:
1) git remote set-url origin [your new repo URL here]
2) git checkout [main branch name]
3) git merge [branch name A] --allow-unrelated-histories
1. Press "i" (i for insert)
2. Write your merge message
3. Press "ESC" (escape)
4. Write ":wq" (write & quit)
5. Then press enter
4) git push -u origin [main branch name]