Subversion : Install2023/07/21 |
Install Subversion which is the revision control System.
|
|
[1] | Install Subversion. |
root@dlp:~# dnf -y install subversion
|
[2] | It's possible to create a repository with any common users. For example, create a repository under the [/home/debian/repos/project]. |
debian@dlp:~$
mkdir -p /home/debian/repos/project debian@dlp:~$ svnadmin create /home/debian/repos/project
# [-m "***"] ⇒ any comments that are logged debian@dlp:~$ svn mkdir file:///home/debian/repos/project/trunk -m "create" Committing transaction... Committed revision 1. debian@dlp:~$ svn mkdir file:///home/debian/repos/project/branches -m "create" Committing transaction... Committed revision 2. debian@dlp:~$ svn mkdir file:///home/debian/repos/project/tags -m "create" Committing transaction... Committed revision 3. |
[3] | To import working files to a new empty repository, do like follows. For example, Import files under the [/home/debian/work] to the [trunk] directory of a new repository. |
debian@dlp:~$ ll ~/work total 28 -rw-r--r-- 1 debian debian 25 Jul 20 19:42 testfile1.txt -rw-r--r-- 1 debian debian 12813 Jul 20 19:42 testfile2.txt -rwx------ 1 debian debian 25 Jul 20 19:44 testscript.py -rwx------ 1 debian debian 726 Jul 20 19:43 testtool.shdebian@dlp:~$ svn import /home/debian/work file:///home/debian/repos/project/trunk -m "initial import" Adding work/testfile1.txt Adding work/testfile2.txt Adding work/testscript.py Adding work/testtool.sh Committing transaction... Committed revision 4. # verify # possible to use [ls] instead of subcommand [list] debian@dlp:~$ svn list file:///home/debian/repos/project/trunk testfile1.txt testfile2.txt testscript.py testtool.sh |
[4] | To copy files in existing repository to local working directory, do like follows. For example, Copy files in a repository [/home/debian/repos/project/trunk] to local working directory [/home/debian/work2]. |
debian@dlp:~$
mkdir ~/work2
# possible to use [co] instead of subcommand [checkout] debian@dlp:~$ svn checkout file:///home/debian/repos/project/trunk /home/debian/work2 A work2/testfile1.txt A work2/testfile2.txt A work2/testscript.py A work2/testtool.sh Checked out revision 4.debian@dlp:~$ ll ~/work2 total 28 -rw-r--r-- 1 debian debian 25 Jul 20 19:46 testfile1.txt -rw-r--r-- 1 debian debian 12813 Jul 20 19:46 testfile2.txt -rwxr-xr-x 1 debian debian 25 Jul 20 19:46 testscript.py -rwxr-xr-x 1 debian debian 726 Jul 20 19:46 testtool.sh |
[5] | When update files in local working directory and you'd like to upload them to repository, do like follows. For example, upload local file [/home/debian/work2/testtool.sh] to repository. |
debian@dlp:~$
cd ./work2
# possible to use [ci] instead of subcommand [commit] debian@dlp:~/work2$ svn commit testtool.sh -m "update testtool.sh 2023072101" Sending testtool.sh Transmitting file data .done Committing transaction... Committed revision 5.debian@dlp:~/work2$ svn info testtool.sh Path: testtool.sh Name: testtool.sh Working Copy Root Path: /home/debian/work2 URL: file:///home/debian/repos/project/trunk/testtool.sh Relative URL: ^/trunk/testtool.sh Repository Root: file:///home/debian/repos/project Repository UUID: 406acacd-7256-439e-9c4a-b9dc46bd4842 Revision: 5 Node Kind: file Schedule: normal Last Changed Author: debian Last Changed Rev: 5 Last Changed Date: 2023-07-20 19:48:41 -0500 (Thu, 20 Jul 2023) Text Last Updated: 2023-07-20 19:48:19 -0500 (Thu, 20 Jul 2023) Checksum: 45e6158faf25bb21272f1281d8f0ca5d3d8c777f # if commit all files, simply run like follows debian@dlp:~/work2$ svn commit -m "update all 2023072101" |
[6] | When creating a new file in local working directory and upload it to repository, do like follows. For example, upload a local new file [/home/debian/work2/index.html] to repository. |
debian@dlp:~/work2$ svn add index.html A index.htmldebian@dlp:~/work2$ svn commit index.html -m "add new index.html 2023072101" Adding index.html Transmitting file data .done Committing transaction... Committed revision 6.debian@dlp:~/work2$ svn update debian@dlp:~/work2$ svn list index.html testfile1.txt testfile2.txt testscript.py testtool.sh |
[7] | If a repository is shared by some people and you'd like to merge the latest update on the repository to your local working directory, use [update] subcommand like follows. |
debian@dlp:~/work2$ svn update Updating '.': U testfile.txt Updated to revision 12. |
Sponsored Link |