Git clone writable: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 6: | Line 6: | ||
if [ $1 = "clone" ]; then | if [ $1 = "clone" ]; then | ||
command git "$@" && chmod -R u+w */.git; | command git "$@" && chmod -R u+w */.git; | ||
#you may prefer | |||
# command git "$@" && chmod -R rm -rf */.git; | |||
else | else | ||
command git "$@"; | command git "$@"; | ||
Revision as of 05:49, 23 July 2022
#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;
#you may prefer
# command git "$@" && chmod -R rm -rf */.git;
else
command git "$@";
fi;
}