Git pull writable

From SlackWiki
Jump to: navigation, search
#Bash function to make git clones writable (annoyingly, if you clone repository, some files are non-user-writable... which after compiling dangerously tempts 'sudo rm -rf!')
git()
{
  if [ $1 = "clone" ]; then
    command git "$@" && chmod -R u+w */.git;
  else
    command git "$@";
  fi;
}