SVN

Technical Notes

These notes are my personal online notebook of useful commands and "how-to's". You are welcome to make use of them if you find them helpful. They obviously don't come with any warranty! Click on one of the category tags above for the notes in any category.

Clear all the contents of a Git repo

The following steps are suggested here: stackoverflow.com/…-repository

  • Here’s the brute-force approach. It also removes the configuration of the repo.
  1. remove all history
rm -rf .git
  1. reconstruct the Git repo with only the current content
git init
git add .
git commit -m "Initial commit"
  1. push to GitHub.
git remote add origin <github-uri>
git push -u --force origin master

Webdav server setup under CentOS 6

I am about to set up a webdav server under CentOS 6.0
Here are some web sources:
-http://www.cyberciti.biz/faq/rhel-fedora-linux-apache-enable-webdav/
-http://www.stigmatedbrain.net/drupal/?q=node/69

Useful Subversion commands

  • To set Id property (ps is short for propset) and list results:
svn ps svn:keywords Id [file(s)]
svn ps svn:executable yes [file(s)]
svn pl -v [file(s)]

Website Releases via Subversion (SVN)

This article was originally posted at:
http://labs.redbd.net/blog/index.cfm/2006/7/5/Website-Releases-via-Subversion-SVN
but this site now seems to be dead, so I have recovered it from archive.org and re-posted it.

If I am breaking any copyrights here, please let me know and I will remove it.

Note that Drupal now blocks any path containing "svn-base". See: http://drupal.org/node/28776


Posted At : July 5, 2006 9:54 PM By : Mark

Managing Acquia Drupal with dget, dsite and dsvn

#place to put dget scripts

DGETDIR=/root/dget


#get dget suite and install it, editing settings.sh if necessary

svn co http://drupal-get.svn.sourceforge.net/svnroot/drupal-get/trunk $DGETDIR
cp $DGETDIR/rename_to_settings.sh $DGETDIR/settings.sh
$DGETDIR/setup.sh $DGETDIR

#check out drupal core, contrib

dsvn checkout

#use dsite checkout if no need to commit from this site
#and optionally, the Acquia distribution (ignore any warning at the end)

dsvn checkout x x a6paths

Notes on Drupal and Subversion

Putting this code into a page will let it update the site from a repository:

<pre>
<?php system( 'svn up sites/default/...'); ?>
</pre><h1>Done!</h1>

Note that apache must have write permission for the whole directory tree.
I tried the following but couldn't get it to work (probably not in my version of PHP):
svn_checkout('http://myserver.com/svn/demo', '/var/www/html/demo/temp');

If the repository requires a password for update, the following can be done:

Install Subversion on CentOS 5 with Apache


yum install subversion mod_dav_svn
mkdir -p /var/www/svn/test #place to keep repository
svnadmin create --fs-type fsfs /var/www/svn/test #make a test one
chown -R apache.apache /var/www/svn
vim /etc/httpd/conf/httpd.conf #make sure the following two lines are there
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
#
vim /etc/httpd/conf.d/subversion.conf #and add the following

<Location /svn>
   DAV svn
   SVNParentPath /var/www/svn
   # Limit write permission to list of valid users.

Useful Subversion Links

Syndicate content