clean git brach code example Example 1: git clean cache $ git rm -r --cached . Example 2: git clear remote branch git remote prune origin