今天在使用git 命令修改分支名称的时候,使用git push 命令提示:
fatal: The upstream branch of your current branch does not match
the name of your current branch. To push to the upstream branch
on the remote, use
git push origin HEAD:feature/facetoface_decode_user
To push to the branch of the same name on the remote, use
git push origin feature/push_data
根本原因在于本地分支feature/push_data是从远程分支feature/facetoface_decode_user重命名得来的,在执行git push命令时,不知道应该与远程哪个分支进行同步,就会出现上面那个错误
解决办法有2个:
1. 使用git建议的命令:git push origin HEAD:feature/facetoface_decode_user 或者 git push origin feature/push_data 执行
2. 也可以重新指定与远程同名的分支(推荐这种方式,执行之后以后就可以git push了)
git push -u origin feature/push_data