Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
fuss:subversion [2017/02/26 13:03] – [Checkout Repository and Overwrite Files] officefuss:subversion [2018/12/11 21:34] – [Ignore Files] office
Line 130: Line 130:
   * the dot ''.'' at the end of the command will export the contents of the ''standalone'' directory (ie: without ending up with ''/etc/samba/standalone'') - thus, it will only pull the configuration files.   * the dot ''.'' at the end of the command will export the contents of the ''standalone'' directory (ie: without ending up with ''/etc/samba/standalone'') - thus, it will only pull the configuration files.
  
 +====== Remove all Local Changes and Additional Files ======
 +
 +To remove all local changes recursively:
 +<code bash>
 +svn revert -R .
 +svn status --no-ignore | grep -E '(^\?)|(^\I)' | sed -e 's/^. *//' | sed -e 's/\(.*\)/"\1"/' | xargs rm -rf
 +svn update --force
 +</code>
 +
 +In case you do not wish to remove files that are not in the subversion repository, then do not issue the ''svn status'' line.
 +
 +====== Ignore Files ======
 +
 +The following command will globally ignore files matching the patterns ''*.pem'', ''*.key'' and ''*.crt'':
 +
 +<code bash>
 +svn propset svn:global-ignore "
 +*.pem
 +*.key
 +*.crt" .
 +</code>
 +
 +Alternatively, ignores can be set local to a current directory. Issuing the command:
 +<code bash>
 +svn propset svn:ignore "
 +*.pem
 +*.key
 +*.crt" .
 +</code>
 +within a directory will make SVN ignore the files in that directory.
 +
 +====== Running Svnserve on Debian ======
 +
 +The ''subversion'' package on Debian is not installed with a service to conveniently start and stop the Subversion ''svnserve''daemon so here are some files that can be used to manage ''svnserve'' in a Debian-compliant way.
 +
 +First create a user and group that ''svnserve'' should run under (in this example, a new user and group ''svnserve'' was created):
 +<code bash>
 +useradd svnserve
 +</code>
 +
 +Then the service file is created at ''/etc/systemd/system/svnserve.service'' with the contents:
 +<code>
 +[Unit]
 +Description=Subversion protocol daemon
 +After=syslog.target network.target
 +
 +[Service]
 +Type=forking
 +RuntimeDirectory=svnserve
 +PIDFile=/var/run/svnserve/svnserve.pid
 +EnvironmentFile=/etc/default/svnserve
 +ExecStart=/usr/bin/svnserve --pid-file /var/run/svnserve/svnserve.pid $DAEMON_ARGS
 +User=svnserve
 +Group=svnserve
 +KillMode=control-group
 +Restart=on-failure
 +
 +[Install]
 +WantedBy=multi-user.target
 +Alias=svnserve.service
 +</code>
 +
 +where:
 +  * ''User'' and ''Group'' has to be changed to the new user has been created.
 +
 +Next, the defaults file for Debian is created at ''/etc/default/svnserve'' with the following contents:
 +<code>
 +# svnserve options
 +DAEMON_ARGS="--daemon --root /srv/svn --log-file /var/log/svnserve/svnserve.log"
 +</code>
 +
 +where:
 +  * ''/srv/svn'' is the parent-path under which all SVN repositories are placed.
 +
 +The ''/var/log/svnserve'' directory must be created:
 +<code bash>
 +mkdir /var/log/svnserve
 +</code>
 +
 +and granted permission to the user and group specified in the system file:
 +<code bash>
 +chown -R svnserve:svnserve /var/log/svnserve
 +</code>
 +
 +A matching logrotate file should be created at ''/etc/logrotate.d/svnserve'' (in order to rotate logs when they get too large) with the following contents:
 +<code>
 +/var/log/svnserve/*.log {
 +    daily
 +    missingok
 +    rotate 14
 +    compress
 +    notifempty
 +    create 640 svnserve svnserve
 +    sharedscripts
 +    postrotate
 +            if /bin/systemctl status svnserve > /dev/null ; then \
 +                /bin/systemctl restart svnserve > /dev/null; \
 +            fi;
 +    endscript
 +}
 +</code>
 +
 +Now, systemctl is instructed to reload the daemon file with:
 +<code bash>
 +systemctl daemon-reload
 +</code>
 +
 +and finally ''svnserve'' is started with:
 +<code bash>
 +systemctl start svnserve
 +</code>
 +
 +====== Fixing Bad Gateway Responses ======
 +
 +When attempting an SVN ''COPY'' or ''MOVE'' command, a repository running under Apache through SSL may yield:
 +<code>
 +svn: E175002: Commit failed (details follow):
 +svn: E175002: Unexpected HTTP status 502 'Bad Gateway' on '/check/!svn/rvr/4/src/server'
 +</code>
 +
 +to address the issue, add to the Apache configuration file:
 +<code>
 +RequestHeader edit Destination ^https http early
 +</code>
 +
 +and restart Apache.
  
  
  

fuss/subversion.txt · Last modified: 2022/04/19 08:28 by 127.0.0.1

Wizardry and Steamworks

© 2025 Wizardry and Steamworks

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.