Contents

Git刪除Rmote Branch方法

之前就有類似寫過刪除 remote 分支方法
但今天想開出來紀錄
有時候刪除 remote 分支
但是我發現我本機上面可以看到刪除的分支(git branch -a)
要怎麼解決呢?

本機刪除

1
git branch -d/-D xxx

遠端刪除(但還是會殘留在本機)

1
git push origin :cat

詳細:git 刪除遠端(remote)分支和強制 pull 下來分支 | 程式狂想筆記

刪除殘留本機 remote

有時候就是不小心打指令
結果不小心checkout進來,它會新增到我分支
等於又要重新刪除分支

git fetch -p or git fetch –all –prune都可以解決

詳細:關於 Git 刪除 Remote Branch - Yowko’s Notes
git 远程修剪,git 修剪,git fetch – prune 等之间的区别是什么 - 代码日志

其他小記:
不修改 commit 內容 --no-edit
Why is git prompting me for a post-pull merge commit message? - Stack Overflow

git - Commit without setting user.email and user.name - Stack Overflow

顯示 git commit 修程式
git log --name-only
How to have git log show filenames like svn log -v - Stack Overflow