git delete

2021-12-21  本文已影响0人  Time_Notes

https://www.freecodecamp.org/news/how-to-delete-a-git-branch-both-locally-and-remotely/

// delete branch locally

git branch -d localBranchName

// delete branch remotely

git push origin --delete remoteBranchName

If you get the error below, it may mean that someone else has already deleted the branch.

error: unable to push to unqualified destination: remoteBranchName The destination refspec neither matches an existing ref on the remote nor begins with refs/, and we are unable to guess a prefix based on thesourceref. error: failed to push some refs to'git@repository_name'


try to synchronize your branch list using:

git fetch -p

The -p flag means "prune". After fetching, branches which no longer exist on the remote will be deleted.

上一篇下一篇

猜你喜欢

热点阅读