一个分支是无意中创建的。我想删除它。实际上,我上周以为我已经删除了它,在bitbucket上搜索时也没有找到它,所以我倾向于认为这个问题只存在于我的本地repo中。为什么在我执行了这个操作后,这个分支仍然出现在我的本地repo中?
$ git branch -d ebc_193_157_154_order_creation_xsd_validation_and_refactored_code
error: branch 'ebc_193_157_154_order_creation_xsd_validation_and_refactored_code' not found.
$ git push bitbucket :ebc_193_157_154_order_creation_xsd_validation_and_refactored_code
error: unable to delete 'ebc_193_157_154_order_creation_xsd_validation_and_refactored_code': remote ref does not exist
error: failed to push some refs to 'bitbucket.org:trueaction/eb2c'
它仍然存在:
$ git branch -r | grep ebc_193
bitbucket/ebc_193_157_154_order_creation_xsd_validation_and_refactored_code
$ git branch -a | grep ebc_193
remotes/bitbucket/ebc_193_157_154_order_creation_xsd_validation_and_refactored_code
我该怎么做才能摆脱它?
git remote prune -n origin
会报告将在origin上被清除的内容,而git remote prune origin
实际上会进行清除。 - Scott Gardner