git automatically remove dead branches code example Example: git clean local remote branch git fetch origin --prune