重命名git本地分支
Git branch -m old_local_branch_name new_local_branch_name
重命名git远程分支
Step1:重命名远程分支对应的本地分支
git branch -m old_local_branch_name new_local_branch_name
step2:删除远程分支
git push origin :old_local_branch_name
step3:重新推送新命名的本地分支
git push origin new_local_branch_name
删除tag
Step1: 显示本地tag
git tag
mytag
Step2: 删除本地tag
git tag -d mytag
Step3: 删除远程tag
git push origin :refs/tags/mytag
远程分支删除以后,本地显示仍然存在的解决办法
显示所有分支:
git branch -a
执行下面命令查看远程分支和本地分支的对应关系:
git remote show origin
会看到:
refs/remotes/origin/my_branch stale (use 'git remote prune' to remove)
执行下面命令同步删除:
git remote prune origin
或者
git fetch -p
再查看,就已经没有了:
git remote show origin