我想要一個別名讓git從本地和遠程存儲庫中刪除一個分支。所以,我在創建一個我~/.gitconfig
:我的Git別名有什麼問題
[alias]
erase = !"git push origin :$1 && git branch -D $1"
它將按預期工作,從源頭和地方分行刪除,但在控制檯中我看到額外的行(error: branch 'profile_endpoints' not found.
):
┌[[email protected]:/c/projects/b developing]
└─$ git erase profile_endpoints
To [email protected]:a/b.git
- [deleted] profile_endpoints
Deleted branch profile_endpoints (was abcdef0).
error: branch 'profile_endpoints' not found.
我在Windows 7上使用git version 1.8.0.msysgit.0
和git bash
。
我錯過了什麼?
該分支遠程存在以及本地?運行命令後如何? – iltempo
分支當然存在於本地和遠程回購中。擦除後它被刪除。通過額外的行顯示git試圖做一些奇怪的事情。 – madhead