[Error report] git push --set-upstream origin XXXX has the same name

 

You encountered an error while trying to push a branch to the remote repository. The error message states that refs/heads/xingfan/demoGit cannot create the branch because a folder named already exists refs/heads/xingfan.

To solve this problem, you can try to rename the local branch and then push it to the remote repository. Here are the steps:

  1. Rename local branch:
git checkout xingfan
git branch -m xingfan_new
  1. Push the renamed branch to the remote repository:
bash
git push --set-upstream origin xingfan_new

This should create a new branch named in the remote repository xingfan_newwithout creating conflicts.

 

Guess you like

Origin blog.csdn.net/DXB2021/article/details/132342298