CentOS 8
Sponsored Link

Subversion : Install
2020/03/27
 
Install Subversion which is the revision control System.
[1] Install Subversion.
[root@dlp ~]#
dnf module -y install subversion
[2] It's possible to create a repository with any common users.
For example, create a repository under the [/home/cent/repos/project].
[cent@dlp ~]$
mkdir -p /home/cent/repos/project

[cent@dlp ~]$
svnadmin create /home/cent/repos/project
# [-m "***"] ⇒ any comments that are logged

[cent@dlp ~]$
svn mkdir file:///home/cent/repos/project/trunk -m "create"

Committing transaction...
Committed revision 1.
[cent@dlp ~]$
svn mkdir file:///home/cent/repos/project/branches -m "create"

Committing transaction...
Committed revision 2.
[cent@dlp ~]$
svn mkdir file:///home/cent/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/cent/work] to the [trunk] directory of a new repository.
[cent@dlp ~]$
ll ~/work

total 12
-rw-rw-r--. 1 cent cent 10 Mar 23 19:06 testfile.txt
-rw-rw-r--. 1 cent cent 10 Mar 23 19:07 testscript.py
-rw-rw-r--. 1 cent cent 10 Mar 23 19:06 testtool.sh

[cent@dlp ~]$
svn import /home/cent/work file:///home/cent/repos/project/trunk -m "initial import"

Adding         work/testfile.txt
Adding         work/testscript.py
Adding         work/testtool.sh
Committing transaction...
Committed revision 4.

# verify

# possible to use [ls] instead of subcommand [list]

[cent@dlp ~]$
svn list file:///home/cent/repos/project/trunk

testfile.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 reposityory [/home/cent/repos/project/trunk] to local working directory [/home/cent/work].
[cent@dlp ~]$
ll ~/work

total 0

# possible to use [co] instead of subcommand [checkout]

[cent@dlp ~]$
svn checkout file:///home/cent/repos/project/trunk /home/cent/work

A    work/testfile.txt
A    work/testscript.py
A    work/testtool.sh
Checked out revision 4.

[cent@dlp ~]$
ll ~/work

testfile.txt
testscript.py
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/cent/work/testtool.sh] to repository.
[cent@dlp ~]$
cd ./work
# possible to use [ci] instead of subcommand [commit]

[cent@dlp work]$
svn commit testtool.sh -m "update testtool.sh 2020032401"

Sending        testtool.sh
Transmitting file data .done
Committing transaction...
Committed revision 5.

[cent@dlp work]$
svn info testtool.sh

Path: testtool.sh
Name: testtool.sh
Working Copy Root Path: /home/cent/work
URL: file:///home/cent/repos/project/trunk/testtool.sh
Relative URL: ^/trunk/testtool.sh
Repository Root: file:///home/cent/repos/project
Repository UUID: 78743b98-4184-4a1f-889d-36068f0a5cce
Revision: 5
Node Kind: file
Schedule: normal
Last Changed Author: cent
Last Changed Rev: 5
Last Changed Date: 2020-03-23 20:40:46 +0900 (Mon, 23 Mar 2020)
Text Last Updated: 2020-03-23 20:43:37 +0900 (Mon, 23 Mar 2020)
Checksum: fc8ed46b507225640735d723e2e0dee3ec202f0d

# if commit all files, simply run like follows

[cent@dlp ~]$
svn commit -m "update all 20200324"

[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/cent/work/index.html] to repository.
[cent@dlp work]$
svn add index.html

A         index.html

[cent@dlp work]$
svn commit index.html -m "add new index.html 2020032401"

Adding         index.html
Transmitting file data .done
Committing transaction...
Committed revision 6.

[cent@dlp work]$
svn list

index.html
testfile.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.
[cent@dlp work]$
svn update

Updating '.':
U    testfile.txt
Updated to revision 12.
Matched Content