Skip to content
mitochondrion edited this page Jul 6, 2016 · 31 revisions

#Clean local branches

  git branch
  git co develop
  git branch --merged
  git branch -d [MERGED BRANCH TO DELETE]
  git branch --no-merged
  git branch -D [UN-MERGED BRANCH TO DELETE]

#Clean remote branches

  git fetch -p (OR git remote prune origin)
  git branch -r
  git branch -r --merged
  git push origin --delete [REMOTE BRANCH TO DELETE]

#List remote merged branches

  • Merged
  for branch in `git branch -r --merged | grep -v HEAD`; do echo -e `git show --format="%ci %cr %an" $branch | head -n 1` \\t$branch; done | sort -r
  • Un-merged
  for branch in `git branch -r --no-merged | grep -v HEAD`; do echo -e `git show --format="%ci %cr %an" $branch | head -n 1` \\t$branch; done | sort -r

#Remove a pushed /Pods folder

  • git filter-branch --index-filter 'git rm --cached --ignore-unmatch Pods/*' --tag-name-filter cat -- --all
  • git push --force

Clone this wiki locally