Send this to a friend
1 svn propset svn:ignore '*' log
2 svn propset svn:ignore '*' tmp/cache
3 svn propset svn:ignore '*' tmp/pids
4 svn propset svn:ignore '*' tmp/sessions
5 svn propset svn:ignore '*' tmp/sockets
6 svn commit -m "Set various ignores"
svn propset svn:ignore '*' log
svn propset svn:ignore '*' tmp/cache
svn propset svn:ignore '*' tmp/pids
svn propset svn:ignore '*' tmp/sessions
svn propset svn:ignore '*' tmp/sockets
svn commit -m "Set various ignores"
Send this to a friend
ignores all files in ‘photo’ folder
1 svn propset svn:ignore “*” public/photo/
svn propset svn:ignore “*” public/photo/
Send this to a friend
1 svn up -r PREV yourfile
Send this to a friend
removes all .svn directories recursively
1 find . -name .svn -exec rm -rf {} \;
2
3 find . -name .svn -print0 | xargs -0 rm -rf
find . -name .svn -exec rm -rf {} \;
find . -name .svn -print0 | xargs -0 rm -rf
Send this to a friend
1 #!/bin/bash
2
3 echo "########################################"
4 echo ""
5 echo ""
6 echo "This bash script creates a new rails project and do the initial svn import with ignoring/deleting files from subversion"
7 echo ""
8 echo ""
9 echo "#######################################"
10
11 echo "Enter svn username: "
12 read username
13 echo "Enter the svn url: "
14 read svn_url
15
16 echo "Enter Rails Application Path:(eg: /home/leonardofaria/Sites/): "
17 read app_path
18 echo "Enter Application Name: "
19 read app_name
20
21 echo "######################################"
22 echo "Please verify the following variables: "
23 echo "Svn Username: ${username}"
24 echo "Svn URL: ${svn_url}"
25 echo "Application Path: ${app_path}"
26 echo "Application name: ${app_name}"
27
28 echo "Proceed (y/n)"
29 read proceed
30
31 if [ ${proceed} = n ] || [ ${proceed} = N ]
32 then
33 echo "Terminating..."
34 exit 0
35 elif [ ${proceed} = y ] || [ ${proceed} = Y ]
36 then
37 app_root="${app_path}/${app_name}"
38 echo "Generating rails project: (${app_root})"
39 rails ${app_root}
40
41 echo "SVNinitial import: "
42 svn import ${app_root} ${svn_url} -m "Initial Import" --username $username
43
44 rm -rf ${app_root}
45
46 echo "Checking out from svn: "
47
48 svn checkout ${svn_url} ${app_root}
49 cd ${app_root}
50 echo "Removing all log files from SVN"
51 svn remove log/*
52 echo "commiting..."
53 svn commit -m 'removing all log files from subversion'
54 echo "Ignoring all log files under log dir"
55 svn propset svn:ignore "*.log" log/
56 echo "Updating and commiting..."
57 svn update log/
58 svn commit -m 'Ignoring all files in /log/ ending in .log'
59
60 echo "Ignoring cache, sessions, sockets inside tmp dir"
61 svn propset svn:ignore "*" tmp/sessions tmp/cache tmp/sockets
62 echo "commiting tmp "
63 svn commit -m "Ignoring all files in /tmp/"
64 echo "Updating and commiting again...."
65
66 svn update tmp/
67 svn commit -m 'Ignore the whole tmp/ directory, might not work on subdirectories?'
68 echo "Moving database.yml to database.example"
69 svn move config/database.yml config/database.example
70 echo "commiting..."
71 svn commit -m 'Moving database.yml to database.example to provide a template for anyone who checks out the code'
72 echo "Ignoring database.yml , updating and commiting..."
73 svn propset svn:ignore "database.yml" config/
74 svn update config/
75 svn commit -m 'Ignoring database.yml'
76 echo "Finished."
77
78 else
79 echo "Unknown Input. Terminating..."
80 exit 0
81 fi
#!/bin/bash
echo "########################################"
echo ""
echo ""
echo "This bash script creates a new rails project and do the initial svn import with ignoring/deleting files from subversion"
echo ""
echo ""
echo "#######################################"
echo "Enter svn username: "
read username
echo "Enter the svn url: "
read svn_url
echo "Enter Rails Application Path:(eg: /home/leonardofaria/Sites/): "
read app_path
echo "Enter Application Name: "
read app_name
echo "######################################"
echo "Please verify the following variables: "
echo "Svn Username: ${username}"
echo "Svn URL: ${svn_url}"
echo "Application Path: ${app_path}"
echo "Application name: ${app_name}"
echo "Proceed (y/n)"
read proceed
if [ ${proceed} = n ] || [ ${proceed} = N ]
then
echo "Terminating..."
exit 0
elif [ ${proceed} = y ] || [ ${proceed} = Y ]
then
app_root="${app_path}/${app_name}"
echo "Generating rails project: (${app_root})"
rails ${app_root}
echo "SVNinitial import: "
svn import ${app_root} ${svn_url} -m "Initial Import" --username $username
rm -rf ${app_root}
echo "Checking out from svn: "
svn checkout ${svn_url} ${app_root}
cd ${app_root}
echo "Removing all log files from SVN"
svn remove log/*
echo "commiting..."
svn commit -m 'removing all log files from subversion'
echo "Ignoring all log files under log dir"
svn propset svn:ignore "*.log" log/
echo "Updating and commiting..."
svn update log/
svn commit -m 'Ignoring all files in /log/ ending in .log'
echo "Ignoring cache, sessions, sockets inside tmp dir"
svn propset svn:ignore "*" tmp/sessions tmp/cache tmp/sockets
echo "commiting tmp "
svn commit -m "Ignoring all files in /tmp/"
echo "Updating and commiting again...."
svn update tmp/
svn commit -m 'Ignore the whole tmp/ directory, might not work on subdirectories?'
echo "Moving database.yml to database.example"
svn move config/database.yml config/database.example
echo "commiting..."
svn commit -m 'Moving database.yml to database.example to provide a template for anyone who checks out the code'
echo "Ignoring database.yml , updating and commiting..."
svn propset svn:ignore "database.yml" config/
svn update config/
svn commit -m 'Ignoring database.yml'
echo "Finished."
else
echo "Unknown Input. Terminating..."
exit 0
fi