git delete remotes: remote refs do not exist

北城余情 提交于 2019-12-02 14:13:28

You may need to prune your local "cache" of remote branches first. Try running:

git fetch -p origin

before deleting.

Mykola Gurov

Are those branches removed from the remote (origin)? If yes, you can simply do

git fetch --prune origin

Otherwise they might return even after you delete them locally.

Update: Looking at your command again, it looks like you're building it incorrectly. You probably want

git push origin --delete myBranch-1234

but instead you are doing something like

git push origin --delete origin/myBranch-1234

Use sed to remove 'origin/' part and change a lttile xargs part.

git branch -r --merged | grep origin | grep -v -e master | sed s/origin\\/// |  xargs -I{} git push origin --delete {}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!