Size: 386
Comment:
|
Size: 3693
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 14: | Line 14: |
svn protected/* themes/* commit -m 'message' | |
Line 18: | Line 19: |
{{{ | {{{#!highlight bash |
Line 21: | Line 22: |
# revert add svn revert addedFile |
|
Line 24: | Line 28: |
== Branches == http://svnbook.red-bean.com/en/1.7/svn.branchmerge.using.html {{{ svn copy http://svn.example.com/repos/calc/trunk http://svn.example.com/repos/calc/branches/my-calc-branch -m "Creating a private branch of /calc/trunk." svn checkout http://svn.example.com/repos/calc/branches/my-calc-branch my-calc-branch }}} == Ignore one folder == http://stackoverflow.com/questions/11293539/equivalent-of-gitignore-file-with-subversion C# example: * cd ~/trunkx * svn propset svn:ignore "bin" . == Ignore several files folders == http://sdesmedt.wordpress.com/2006/12/10/how-to-make-subversion-ignore-files-and-folders/ svnignore.txt {{{ obj bin }}} Issue the command to ignore the folders listed inside the file * svn propset svn:ignore -F svnignore.txt . * svn status --no-ignore # see ignored files * svn propedit svn:ignore . # shows ignore list on editor * SVN_EDITOR=nano * svn propedit svn:ignore . # uses nano * svn proplist -v -R # shows all properties recursively Add to ~/.bashrc {{{ # export SVN_EDITOR=vi export SVN_EDITOR=nano }}} == Merge == * cd mergeDestination * svn merge --accept postpone originFolder -r1234:HEAD #postpone to resolve conflicts later * svn status | grep '^C ' # only show files with conflits * svn resolve --accept working filex #accepts that working copy of filex does not have conflicts * svn update --accept postpone # updates working copy and automatically postpones conflict resolution == Diff between branches == * svn diff --summarize http://example/svn/repository/branch1 http://example/svn/repository/branch2 == Commit with message(s) in file == * nano messages.txt * svn commit -F messages.txt --username userx == Files added or modified == {{{ svn status | grep "^A\|^M" }}} == Cherrypicking == * svn diff -c 1234 ~/calc/trunk # see diff for revision 1234 * svn merge -c 1234 ~/calc/trunk # merge revision 1234 == Solve conflict == * svn resolved path/file # mark as solved == Revert working copy == * svn revert --recursive . == Mark script as executable == * svn propset svn:executable on xyz.sh == Search logs by username == * svn log --search username == Get folder without content == * svn ls * svn up "folderx" -N == svnserve == The svnserve program is a lightweight server, capable of speaking to clients over TCP/IP using a custom, stateful protocol. Listens port 3690 http://svnbook.red-bean.com/en/1.7/svn.serverconfig.svnserve.html * mkdir -p /tmp/svnserver * svnserve -d -r /tmp/svnserver * svnadmin create --fs-type fsfs /tmp/svnserver/testrepo * cd /tmp * svn checkout svn://localhost/testrepo * cd testrepo '''/tmp/svnserver/test/conf/passwd''' {{{ [users] harry = 1234 sally = 1234 }}} '''/tmp/svnserver/test/conf/svnserve.conf''' {{{ [general] password-db = passwd [sasl] use-sasl = false }}} {{{#!highlight bash touch a svn add a svn commit a --username harry --password 1234 svn log svn up . svn log svn ls mkdir branch tag trunk svn rm a svn status svn add branch/ tag/ trunk/ svn status svn commit -m "Created branch tag trunk" --username harry --password 1234 }}} |
Subversion
Subversion is an open source version control system
https://subversion.apache.org/
Update
svn update
Commit
svn commit -m 'message' svn protected/* themes/* commit -m 'message'
Add unversioned files
/usr/bin/svnaddunversioned.sh:
- chmod 755 /usr/bin/svnaddunversioned.sh
Branches
http://svnbook.red-bean.com/en/1.7/svn.branchmerge.using.html
svn copy http://svn.example.com/repos/calc/trunk http://svn.example.com/repos/calc/branches/my-calc-branch -m "Creating a private branch of /calc/trunk." svn checkout http://svn.example.com/repos/calc/branches/my-calc-branch my-calc-branch
Ignore one folder
http://stackoverflow.com/questions/11293539/equivalent-of-gitignore-file-with-subversion
C# example:
- cd ~/trunkx
- svn propset svn:ignore "bin" .
Ignore several files folders
http://sdesmedt.wordpress.com/2006/12/10/how-to-make-subversion-ignore-files-and-folders/
svnignore.txt
obj bin
Issue the command to ignore the folders listed inside the file
- svn propset svn:ignore -F svnignore.txt .
- svn status --no-ignore # see ignored files
- svn propedit svn:ignore . # shows ignore list on editor
- SVN_EDITOR=nano
- svn propedit svn:ignore . # uses nano
- svn proplist -v -R # shows all properties recursively
Add to ~/.bashrc
# export SVN_EDITOR=vi export SVN_EDITOR=nano
Merge
- cd mergeDestination
- svn merge --accept postpone originFolder -r1234:HEAD #postpone to resolve conflicts later
- svn status | grep '^C ' # only show files with conflits
- svn resolve --accept working filex #accepts that working copy of filex does not have conflicts
- svn update --accept postpone # updates working copy and automatically postpones conflict resolution
Diff between branches
svn diff --summarize http://example/svn/repository/branch1 http://example/svn/repository/branch2
Commit with message(s) in file
- nano messages.txt
- svn commit -F messages.txt --username userx
Files added or modified
svn status | grep "^A\|^M"
Cherrypicking
- svn diff -c 1234 ~/calc/trunk # see diff for revision 1234
- svn merge -c 1234 ~/calc/trunk # merge revision 1234
Solve conflict
- svn resolved path/file # mark as solved
Revert working copy
- svn revert --recursive .
Mark script as executable
- svn propset svn:executable on xyz.sh
Search logs by username
- svn log --search username
Get folder without content
- svn ls
- svn up "folderx" -N
svnserve
The svnserve program is a lightweight server, capable of speaking to clients over TCP/IP using a custom, stateful protocol. Listens port 3690 http://svnbook.red-bean.com/en/1.7/svn.serverconfig.svnserve.html
- mkdir -p /tmp/svnserver
- svnserve -d -r /tmp/svnserver
- svnadmin create --fs-type fsfs /tmp/svnserver/testrepo
- cd /tmp
- svn checkout svn://localhost/testrepo
- cd testrepo
/tmp/svnserver/test/conf/passwd
[users] harry = 1234 sally = 1234
/tmp/svnserver/test/conf/svnserve.conf
[general] password-db = passwd [sasl] use-sasl = false