Advertisement
Guest User

git commit ignore script

a guest
Oct 1st, 2016
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.31 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. if [ $1 == 'commit' ]; then
  4.   if [ -e .gitignore ]; then
  5.     cp .gitignore .git/.gitbak
  6.     ls >> .gitignore
  7.     git $1 $2 "$@"
  8.     cp .git/.gitbak .gitignore
  9.     rm .git/.gitbak
  10.   else
  11.     ls > .gitignore
  12.     git add .gitignore
  13.     git $1 $2 "$@"
  14.     rm .gitignore
  15.   fi
  16. else
  17.   git $@
  18. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement