当前位置:网站首页>Alibaba cloud server builds SVN version Library
Alibaba cloud server builds SVN version Library
2022-07-06 16:55:00 【LuckyShawn】
Build and use SVN
Preface
Subversion(SVN) It's an open source version control system , in other words Subversion Managing data that changes over time .
The data is placed in a central repository (repository) in . This archive is very similar to a normal file server , But it remembers every file change . So you can restore the file to the old version , Or browse the history of file changes .
SVN Some of the concepts of
- repository( Source code library ): The place where the source code is stored
- Checkout( extract ): When you have no source code , You need to go from repository checkout A source code
- Commit( Submit ): If you have modified the code , You need to Commit To repository
- Update( to update ): When you have Checkout A copy of the source code ,Update once , You can work with Repository Source code synchronization on , The code in your hand will have the latest changes
The daily development process is actually like this ( Suppose you have Checkout And I've been working for a few days ):Update( Get the latest code )—> Make your own modification and debug successfully —> Commit( You can see your modification ).
If you and your colleagues modify the same file at the same time ,SVN You can merge your changes , actually SVN Managing source code is done in units of behavior , That is, as long as you don't modify the same line of program ,SVN Both changes are automatically merged . If it's the same line ,SVN Will prompt the file Confict( Conflict ), Need to confirm manually .
install SVN
You can use any of the following methods to install SVN.
Use SVN Version control image
You can buy and use in the cloud market SVN Version control image Of ECS example .
After the instance is created , Follow these steps :
- Sign in ECS Administrative console .
- In the left navigation bar , single click example .
- Choose the region .
- Find the newly created ECS example , stay IP Address List the public network of the instance IP Address .
Manual installation SVN Manual installation SVN
This article takes CentOS 7.2 64 For example, bit system , Explain how to use CentOS 7.2 Installation on SVN.
- Remote connection Linux example .
- Run the following command to install SVN.
yum install subversion
- Run the following command to see SVN edition .
svnserve --version
- Follow these steps to create a version Library :
- Run the following command to create a directory .
mkdir /var/svn
- Run the following commands in sequence to create the version Library .
cd /var/svn
svnadmin create /var/svn/svnrepos
- Run the following commands successively to view the automatically generated version library file .
cd svnrepos
ls
Subversion Directory description :
- db Catalog : All version control data storage files .
- hooks Catalog : place hook Directory of script files .
- locks Catalog : The client used to track access to the file library .
- format file : It's a text file , There's only one integer in it , Represents the version number of the current file library configuration .
- conf Catalog : This is the configuration file of the warehouse ( User access account of the warehouse 、 Authority, etc ).
- Run the command cd conf/ Get into conf Catalog ( The SVN Version library configuration file ). The results are as follows :
- authz: It's a permission control file .
- passwd: It's an account and password file .
- svnserve.conf:SVN Service profile .
Follow the steps below to set the account and password :
vi passwd.
1. Press i Key to enter edit mode .
2. stay [users] Add user account and password to the block , Format : account number = password , For example, in the example suzhan = redhat( Note that there should be a space at both ends of the equal sign ).
3. Press Esc Key to exit edit mode , And enter the :wq Save and exit .
Follow these steps to set permissions :
function vi authz.
- Press i Key to enter edit mode .
- Add the following code at the end ( among ,r Express reading ,w Said to write ):
[/]
suzhan=rw - Press Esc Key to exit edit mode , And enter the :wq Save and exit .
Follow the steps below to modify svnserve.conf file .
- Run the command vi svnserve.conf.
- Press i Key to enter edit mode .
- Open the following comments ( Note that each line cannot start with a space , There should be a space at both ends of the equal sign ):
anon-access = read # Anonymous users can read , You can also set anon-access = none, Anonymous users are not allowed to access . Set to none, The log date can be displayed normally
auth-access = write # Authorized users can write
password-db = passwd # Which file is used as the account file
authz-db = authz # Which file is used as the permission file
realm = /var/svn/svnrepos # Authentication space name , Version Library Directory
- Press Esc Key to exit edit mode , And enter the :wq Save and exit .
Run the following command to start SVN Version Library .
svnserve -d -r /var/svn/svnrepos
Run the command ps -ef |grep svn see SVN Whether the service is on .
If the returned result is as shown in the figure below , Express SVN The service has been turned on .
explain Run the following command to stop SVN command .
killall svnserve
Add security group rule
SVN The default port for the service is TCP 3690. You need to log in ECS Administrative console , Add security group rule release TCP 3690 port .
stay Windows Up test
This section explains how to get local (Windows operating system ) visit ECS Installed on the instance SVN service .
Install... On the local machine TortoiseSVN client .
In your local project folder ( As in the example C:\KDR), Right click the blank space to pop up the menu , choice SVN Check out the .
Specify Repository URL, The format is svn:// Instance public network IP Address / Resource library name ; Appoint Check out to directory ( As in this example C:\KDR); Click again determine .
If the message shown in the figure appears , Indicates that the check-out is successful .
explain Password required for first login , All with passwd The account password in the file is mainly .
Modify and submit the project
After downloading the project to the local machine , You can add files in 、 Modify file 、 Delete files, etc .
Commit changes
Follow the steps below to submit the modification :
Right click in the blank space of the project file , choice SVN Submit .
Enter the version update information submitted this time ( Comments on the changes made )、 Check the operation content to be submitted , single click determine , You can submit the local project to SVN Server repository , Overwrite the repository item to realize the update .
explain
If there is a submission conflict , That is, both of them submit modifications , The post submitter will fail to submit due to the backward version . At this time, you can back up your project first , After downloading the latest project from the server , Then overwrite your project to the local project folder , Last SVN Submit to successfully submit .
Suppose you just deleted a file , The information shown in the screenshot below will be displayed here .
Get updates
If someone else modifies SVN Items on the server repository , You want to download the latest project , Right click the blank space of the local project file , choice SVN to update , Download can be completed automatically , It will also prompt what updates have been made .
explain Select... In the original project folder SVN to update , Will automatically overwrite the original content . We recommend that you back up , Update again , Prevent your original project content from being lost .
SVN Restore
Open a folder , Right click to check out data .
Delete the data .
Take different actions according to whether you have submitted the modification :
When not submitted , Right click the blank space , choice TortoiseSVN > SVN Restore .
When submitted , The data in the system library will also be synchronized , The system will also delete its stored data . here , You need to take the following methods to restore data :
Check the log , Confirm which files have been deleted .
Save the deleted file version to the deleted location .
Open the original folder , choice SVN Submit , The data in the system library is synchronized with this file .
边栏推荐
- Error: case label `15 'not within a switch statement
- CMake速成
- LeetCode 1545. Find the k-th bit in the nth binary string
- LeetCode 1558. Get the minimum number of function calls of the target array
- Go language uses the thrift protocol to realize the client and service end reports not enough arguments in call to oprot Writemessagebegin error resolution
- 原型链继承
- Shell_ 07_ Functions and regular expressions
- Saw local status change event StatusChangeEvent [timestamp=1644048792587, current=DOWN, previous=UP]
- was unable to send heartbeat
- ~87 animation
猜你喜欢
The QT program compiled on CentOS lacks a MySQL driven solution
Fdog series (4): use the QT framework to imitate QQ to realize the login interface, interface chapter.
7-10 punch in strategy
Simply try the new amp model of deepfacelab (deepfake)
字节跳动海外技术团队再夺冠:高清视频编码已获17项第一
字节跳动2022校招研发提前批宣讲会,同学们最关心的10个问题
Solr standalone installation
Soft music -js find the number of times that character appears in the string - Feng Hao's blog
Shell_ 04_ Shell script
Erlang installation
随机推荐
字节跳动多篇论文入选 CVPR 2021,精选干货都在这里了
Basic principles of video compression coding and audio compression coding
我在字节跳动「修电影」
Record the error reason: terminate called after throwing an instance
js垃圾回收机制和内存泄漏
音视频开发面试题
The QT program compiled on CentOS lacks a MySQL driven solution
LeetCode 1560. The sector with the most passes on the circular track
7-4 harmonic average
Fdog series (4): use the QT framework to imitate QQ to realize the login interface, interface chapter.
JS encapsulates the method of array inversion -- Feng Hao's blog
~83 form introduction
Solr new core
Introduction to microservices
Solve the problem of intel12 generation core CPU [small core full, large core onlookers] (win11)
Native JS realizes the functions of all selection and inverse selection -- Feng Hao's blog
Educational Codeforces Round 122 (Rated for Div. 2)
Shell_ 00_ First meeting shell
LeetCode 1557. The minimum number of points that can reach all points
LeetCode 1984. Minimum difference in student scores