Git clone writable: Difference between revisions

From SlackWiki
Jump to navigation Jump to search
m (Dchmelik moved page Git pull writable to Git clone writable)
No edit summary
Line 1: Line 1:
[[Category:Tips]]
[[Category:Tips]]
<pre>
<pre>
# bash function to set git clones user-writable (annoyingly if you clone repository some files are non-user-writable... dangerously tempts 'sudo rm -rf'!)
# bash function: set git clones user-writable (annoyingly if you clone some files are non-user-writable... dangerously tempts 'sudo rm -rf'!)
git()
git()
{
{
   if [ $1 = "clone" ]; then
   if [ $1 = "clone" ]; then
    # Might work.
    #find . -iname .git* -perm u-w -exec chmod u+w {} \+;
     command git "$@" && chmod -R u+w */.git*;
     command git "$@" && chmod -R u+w */.git*;
   #you may prefer
   #you may prefer

Revision as of 05:14, 27 July 2022

# bash function: set git clones user-writable (annoyingly if you clone some files are non-user-writable... dangerously tempts 'sudo rm -rf'!)
git()
{
  if [ $1 = "clone" ]; then
    # Might work.
    #find . -iname .git* -perm u-w -exec chmod u+w {} \+;
    command git "$@" && chmod -R u+w */.git*;
  #you may prefer
  #  command git "$@" && rm -fR */.git*;
  else
    command git "$@";
  fi;
}