Git clone writable

From SlackWiki
Revision as of 15:03, 20 May 2020 by Dchmelik (talk | contribs) (Created page with "Category:Tips <pre> #Bash function to make git clone writable (annoyingly, if you clone repository, some files are non-user-writable... which after compiling dangerously t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
#Bash function to make git clone 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 "$@" && find */.git -type f -perm ! -u=w -exec chmod u+w {} \;
  else
    command git "$@";
  fi;
}