Skip to content

Instantly share code, notes, and snippets.

@phynet
Last active March 28, 2017 10:50
Show Gist options
  • Save phynet/1119047e74a2590855ba9aa8a2301d04 to your computer and use it in GitHub Desktop.
Save phynet/1119047e74a2590855ba9aa8a2301d04 to your computer and use it in GitHub Desktop.
Alias to delete a remote branch and to delete .DS_Store files from our repo

Bash profile file:

alias git-rmDS="find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch"

alias git-rmb='function _delete_branch(){ echo "Deleting branch: $1"; git push origin --delete "$1"; };_delete_branch'

Use with Command Line as:

  1. Delete a remote branch

     $ git-rmb name-of-your-branch
    
  2. Delete .DS_Store

     $ git-rmDS
     $ git commit -m '.DS_Store deleted!'
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment