Daily use of SVM

yum install -y subversion #yum install

In the compilation and installation of SVN installation chapter, the linux machine has been tested as a client

[root@localhost ~]# svnserve -d -r /home/svn-repo/ #Start a large warehouse, why start a large warehouse because you can build a small warehouse below, you don't need to start multiple at the same time,

ps –ef|grep svn Check that if it is already started, you don’t need to start it again

image

 

[root@localhost svn-repo]# svnadmin create /home/svn-repo/wind #Create a small warehouse wind client test

image

conf #config

              authz #Edit the authority control file authz, divide groups, add users to groups and authorize

               passwd #Add access user and corresponding password

                svnserve.conf # Warehouse configuration file access modification

               

db #Save the submitted code

hhooks #implement advanced functions

locks #locked files

 

 

[root@localhost conf]# vim /home/svn-repo/wind/conf/svnserve.conf #Set up anonymous access first, then test it later, the modification will take effect without restarting

image

anonymous test

image

 

image

image

new file test

image

1. Join (add)

image

2. Submit (conmoit)

image

3. Notes

image

delete test

image

Check it out again

image

image

image

normal test

image

Anonymous in the above test

 

账号密码测试>>>>>>>>>>>>>>>>>>>>>>>>>>>>

1. Edit the account password file passwd, add the access user and the corresponding password

[root@localhost ~]# vim /home/svn-repo/wind/conf/passwd

image

2. Edit the permission control file authz, divide groups, add users to groups and authorize

vim /home/svn-repo/wind/conf/authz

image

Configured under [groups] is a list of group = group user 1, group user 2, indicating which users are in each group

[/]: The root directory here refers to the project root directory, not the system root directory

@g_admin = rw: Indicates the permissions of the g_admin group, where r means read and w means write, that is, the group has read and write permissions to the project root directory

[/dev]

@g_dev = rw

Indicates that the g_dev group has read and write permissions to files in the dev directory under the root directory

3. Edit the service configuration file to enable users and policies to take effect

[root@localhost ~]# vim /home/svn-repo/wind/conf/svnserve.conf

image

The above configuration items are described as follows:

[general]

anon-access=none #Do not allow anonymous users to access

auth-access = write #Authenticated users can read and write, users in passwd.conf

password-db = /var/svn/lemon/conf/passwd #User save file

authz-db = /var/svn/lemon/conf/authz #authority management file

realm = lemon#Authentication space name, the directory where the repository is located

 

5. Check out at wind

image

image

Login with account and password

image

The following test is the same as the anonymous test above

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Installation instructions: The following is the account password test:

Developers strongly recommend using the SVN plugin in the IDE to be more intelligent and user-friendly.

First install the SVN client. Windows generally choose the turtle client https://tortoisesvn.net/downloads.html .
Select the corresponding client to install according to the number of system bits.

image_1ak3avt6j1k2p1f6h1cg711lp3pu9.png-57.9kB

If you like to use the command line, please remember to check command line client toolas will be install on local hard driver, skip this step without the command line.

image_1ak3cf587b5a15j21i9s1ne8uhf1g.png-55kB

Then all the way to next can be installed. After installation, right-click anywhere to view the shortcut menu. If found TortoiseSVN, the installation is successful.

image_1ak3cneu9tb6pu8k44rck90k1t.png-135kB

If the installation command line tool is checked, then enter the command SVN, and the following prompt also indicates that the installation is successful

image_1ak3ctqp61c0a1vku1e30cib9312a.png-9.6kB

But the menus are all in English at this time. If you are not used to English, you can download the language pack and remember to check the system digits.

image_1ak3b28uv1et21lelqiglpr1krjm.png-46.3kB

After installing the language pack, you can right-click to enter the settingsettings.

image_1ak3d7reg1tdhdqjhfhim319d2n.png-89.7kB

Select the language you like (such as Chinese), and then confirm, no accident, the language has now been switched to Chinese.

image_1ak3dama4kcf1flmr9a8d1hqe34.png-187kB

This is the end of the installation tutorial. Let's start to introduce the use of SVN.

Instructions for use

Check out an item

If the project is already in the server's repository, all you have to do now is to check it out locally.
First create an empty folder. Right-click in an empty folder and select SVN Checkout.

image_1ak3do46q18kl1l79c9u4pu1mdd3h.png-21.5kB

Now you see this interface, fill in the repository address, and select OK.

image_1ak3dsjn6ha81ojlg2a1b1h67o3u.png-40.8kB

A dialog box will pop up for you to enter your account password, just enter your account password. Remember to tick Save Authentication, otherwise you will be asked to enter every time you operate.

image_1ak3e0eesor01kg616s81aj11h524b.png-21.5kB

Check out in a few minutes.

image_1ak3e38931rr19dg1cbd1t8pn3g4o.png-51.4kB

At this point you can see your project in your directory, and now you can start working happily.

image_1ak3e6ja4gnsvep1oaluia2pp55.png-5.3kB

import project

But sometimes you have already built a project locally and need to push your project to SVN. What should you do at this time?
Right-click and select Repository Browser.

image_1ak3eopb116i6192u14i4c7r1avu6c.png-101kB

In the corresponding directory, right-click, add file/add folder, and select the corresponding directory.

image_1ak3etni4fba1oi017rv1u6m1gn16p.png-116kB

For example, I now have a project called SVNProject, and I want to upload it to SVN.

image_1ak3f04bl1k5q1qmrrcmu4m1j2j76.png-50.7kB

Then I just choose to join the folder.

image_1ak3f5l6f1h8f1rimgee1544sdc7j.png-35kB

Be sure to enter submission information. So others can know what you did.

image_1ak3f7oe71gs6mkdlucdrrqq880.png-31.7kB

After the import is successful, you can see the directory.

image_1ak3fbqo13gu1uji53ku5g1bs68d.png-110.6kB

However, don't assume that the import is successful and that's it. You have to check out again, the re-checked out project is controlled by SVN, be sure to remember to check out.

image_1ak3fghhcg9fk9oab61n5q1sqg8q.png-110.6kB

Right-click on SVNProject to check out to the local, and then modify it inside. Now you can work happily.
The right-click menu after checking out becomes like this.

image_1ak3fnbnn1ber1u0k1hbs1ti6ovi97.png-24.4kB

submit

Green indicates that the current file has not been modified (restart the computer if you cannot see the color).

image_1ak3g3u171j9j1r40mbp1hkv12ju9.png-4.1kB

Suppose I now 我是新项目.txtadd a line of words in and save it.

image_1ak3g7ct21svq1lrejruu6e16okm.png-6.1kB

The discovery is now red, which means it has been modified.

image_1ak3g9vfl1rqc1mvb19s81hg1t3913.png-4.9kB

How to submit changes?
In the root directory, right-click and select Submit.

image_1ak3gdc7j17dt1n50d1l8e1trp1g.png-25.2kB

Be sure to remember to enter the submission information (although you can submit it without entering it), the submission information can be easily viewed in the future.

image_1ak3gif5h13l11rfmorm87g5a71t.png-74kB

After the submission is complete, it can be found that it has returned to green.

image_1ak3gngr3o2amk41abkod91ogi2a.png-5kB

Suppose now that a new file is added. It can be seen to be blue. Blue indicates unknown files that do not belong to the repository, and unknown files cannot be submitted.

image_1ak3grpb5hgbs62sj4tthfql2n.png-11.6kB

Remember to select Add to add it to the repository.

image_1ak3h1boe1njh1dhrhu1bjr1t333k.png-50.7kB

After the addition is complete, it becomes a blue plus sign, indicating the newly added version library file.

image_1ak3h5j9j1j4cnfhhq2vv2lba41.png-4.3kB

Next, just write the code and submit it.
Deleted files should also be right-clicked and submitted, as follows.

image_1ak3hcqrakda18mc5pg1dlke4d4e.png-57.7kB

Remember to check the status of your files at any time, and if they are not added to version control, add them in time, otherwise your files will not be submitted.

renew

Suppose you and classmate B are collaborating. After classmate B wrote the code and submitted it to SVN, if you want to get the latest modification, you need to select update (if there are new ones submitted by others on the server, you cannot submit them, you must update them before submitting).
How do I know if the server has been updated? You can directly choose to update, and you will know if there is an update. Or right-click to check for changes, and then check the repository to see which files have been changed on the server.

image_1ak3i1mon1f871qr9178eds61qoq4r.png-100.3kB

Right-click and select HEAD and BASE to compare.

image_1ak3i7ql4mre1t6e17r717o81nlq58.png-22.9kB

The one on the left represents your code, and the one on the right represents the code on the server.

image_1ak3i9ado1p6cv6aoh460210it5l.png-117.7kB

If there are changes, remember to update to the local in time and then continue to work.

But sometimes the update will conflict, for example, you and the server have changed the same place.
At this point you need to update to resolve the conflict.

image_1ak3ihv861ceq1gko16jl1uu3mqe62.png-68.8kB

It will prompt you which file is in conflict, you just need to open that file and resolve the conflict as required.

image_1ak3ikl7a1c9dmk619r9d371mui6f.png-11.4kB

<<<<<<.mine to ==== for your code, others for the server's code. You just change to what you want.

image_1ak3iojkm7ic6911jr39021qk46s.png-5.1kB

Then select Resolve and tell SVN that I have resolved the conflict.

image_1ak3itj8gt8315rf1flij6k1l1979.png-41.3kB

The rest is the update submission operation between team collaborations, which will not be repeated here.

View logs

Choose to show the log, you can see what the people in the team have done.

image_1ak3j48bv6r9tnm821u3gpjn7m.png-30kB

You can see who is who, what time, and what. The last column of information was written when I submitted it myself. It is recommended that you fill in the submission information when submitting, so that others can see what you have done. Submitting information is also good for you, and you can see what you did after a long time.

image_1ak3j7va3jbt147j1s2thni1eui83.png-98.6kB

version rollback

If you change something, but haven't committed it yet, you can use the revert feature.
image_1ak4pcd3bpac328t5u1mas1k1v9.png-103kB
But what if we wrote something wrong and committed it? A file can be restored to a
previous version with version rollback. Right-click to update to the version, select the version by viewing the log, and then roll back.
image_1ak3k9pl5nt0euj10eob6e1pai8t.png-21.1kB

Sometimes we need to look at previous versions of the code. At this point we can create a new folder to check out to the specified version.

image_1ak3kifgr1b1q1fv0p871f25jda9a.png-158.9kB

version control

There are several methods of version control, as follows.

  1. This is the easiest way to add version information when submitting a release build.
    image_1ak3locvo1ndq4pg1nohuhn1fh89n.png-17.1kB

  2. Tagging should be tagged
    every time a version is released. Right click and select branch/tag. Label the to path with the version number
    image_1ak3muiav1t0o9v21a5qfnt3ut9.png-28.3kB
    image_1ak4tm0e3aal1t71r94p941h9p2a.png-80kB
    so you have a v1.0 version label.
    If you want to view a certain version of the code in the future, just switch to the past
    image_1ak3n7ai51l6b77j10811plc12ba13.png-14.9kB

Summarize

In our daily use, the most commonly used are update and commit operations. These two steps must be very skilled. The other thing you can do when you run into problems is to look at the documentation. In addition, it should be noted that all version control tools can only track text files (files that can be opened and viewed with Notepad), don't delusional SVN can record which line you changed in word. Once you encounter a word conflict, remember to carefully compare the two versions, and then resolve the conflict.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324838422&siteId=291194637
svm