Is there a way to safely but thoroughly forget a git branch after it is deleted?

  Kiến thức lập trình

It is handy to be able to press the tab key and get automated command completion, such as to fill out the remainder of the name of a branch. However, if one types…

git switch de[tab]

… and there are two or more branches that begin with the initial fragment (e.g. “de”), then command completion stops. For example, if there is a branch develop and a branch dev-1234, then the above stops at…

git switch dev

This limitation remains the case even after one has deleted all but one of the branches. For example, after deleting dev-1234, the above example still stops with “dev”. For command completion purposes, it seems to still remember that there was a branch dev-1234, even if that is no longer in the list of branches.

Of course, it can be desirable to be able to restore a branch that has been mistakenly deleted and there are MANY pages that discuss the recovery process.

But consider the case where the deleted branch has been merged and one does not want to recover or restore it. In this example, is there a safe way to make git command completion forget that there had been a branch called dev-1234 so that command completion can once again expand “de” to “develop”?

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT