开发者

How to delete remotes/origin/{branch}?

How do you delet开发者_运维百科e a remotes/origin/{branch}?


use: git remote prune origin

or use git remote prune origin --dry-run to preview what branches will be removed.

As in git help remote

prune
Deletes all stale remote-tracking branches under . These stale branches have already been removed from the remote repository referenced by , but are still locally available in "remotes/".

With --dry-run option, report what branches will be pruned, but do not actually prune them.


Let's say you've fetched a branch like so:

git fetch origin MT-2766

To remove the corresponding remote-tracking branch run:

git branch -r -d origin/MT-2766


git push origin :[branch-name].

Source: http://progit.org/book/ch3-5.html


git branch -r -d origin/branch-name worked for me when the remote branch was already deleted (so git push origin --delete <branch-name> wasn't possible) and git prune origin wasn't doing anything (for a reason I don't yet understand)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜