Setting the SVN "execute" bit in a Subversion repository using TortoiseSVN or command line SVN

42,739

Solution 1

Here's how to do it on the command line:

for file in `find . -name configure`; do
  svn ps svn:executable yes ${file}
done

Or for just one file (configure is the filename here):

svn ps svn:executable yes configure

Solution 2

On Unix use {} to adress resulset:

find . -type f -name "*.bat" -exec svn propset svn:executable yes '{}' \;

Does anyone know why this property requires "yes" as valid argument? Found another example with '' instead of yes, works too...

Solution 3

find . -type f -name "*.bat" -exec svn propset svn:executable yes "${}" \;

Of course the same goes for .exe, etc.

Solution 4

Method for restoring executable permissions that are lost during svn import:

copy permissions from your original source that you used during svn import (current dir to version1):

find . -type f | xargs -I {} chmod --reference {} ../version1/{}

then set svn:executable for all executables using the following shell script:

for file in `find . -executable -type f`; do
  svn ps svn:executable yes ${file}
done
Share:
42,739
KPexEA
Author by

KPexEA

Video game programmer, mainly c, c++ First programmed on the Commodore Pet back in 1981 Last project Zombie Apocalypse: Never die alone Some of my memorable projects include: Test Drive (Accolade, c64) Stunts (Br0derbund, pc) Fifa International Soccer (EA, Sega Genesis) Platforms I have worked on: Commodore Pet, Vic 20, C64, Apple ][, Atari 800XL, PC, Linux, Sega Genesis, Sega CD, Sega 32x, Nintendo SNES, N64, PlayStation, PS2, PS3, Xbox, X360, STM32-Primer2, GP2X-Wiz, Chrome Native-Client

Updated on July 09, 2022

Comments

  • KPexEA
    KPexEA almost 2 years

    I've got an open-source app that is hosted at code.google.com. It is cross platform ( Linux / Windows / Mac ). I uploaded the code initially from a WinXP machine using TortoiseSVN and it seems that none of the "configure" batch files that are used for the linux build have their "execute" bits set.

    What would be the easiest way to set these for the files that need them? Using TortoiseSVN would be easier, I suppose, but if that can't be used, then I could also use the command line SVN on my linux machine.

  • Grhm
    Grhm over 13 years
    THe svn:executable property is a boolean value. Setting it to "yes" or "" or _anything_ is sufficient. svn checks if the property is set, not its content - most clients with report the value as '' even if you set it to 'yes'.
  • Michael H.
    Michael H. over 11 years
    You can also use propset on a list of files -- see stackoverflow.com/a/5757365/134647
  • Rich Sutton
    Rich Sutton over 11 years
    Note that to clear the executable bit you have to use svn propdel svn:executable <foo>. You can't just set it to "no".
  • Betlista
    Betlista over 6 years
    This is Windows version? Just wondering, that erik's answer, which is younger has more votes, seems pretty same to me...