How to Use SVNcommit in Ubuntu

Source: Internet
Author: User
A simple command: sudoapt-getinstallsubversion assumes that the working path of your project (the working path of the project you just created has not performed any svn operations) is: /home/zzm/myproject # create a repositorysvnadmincreate/home/zzm/svn-repo/myproject # Put/home/zzm/myproje

A simple command: sudo apt-get install subversion

Assume that the working path of your project (the working path of the project you just created, has not performed any svn operations) is/home/zzm/myproject

# Create a repository named myproject
Svnadmin create/home/zzm/svn-repo/myproject

# Import the content in/home/zzm/myproject to the svn version library and create a version library for this project. The version number is 1.
Svn import-m "is the first version of your project. The imported"/home/zzm/myproject file: // home/zzm/svn-repo/myproject

Now I want to talk to you about the concept of working copy in svn. In fact, we have created two folders on top, one of which is your project folder:/home/zzm/myproject, the other is the version library folder of your project:/home/zzm/svn-repo/myproject. Both folders are not so-called working copy, real working copy is directly responsible for synchronization and record operations with the version library. There is a hidden working copy folder. svn folder. Usually I do not directly operate in the working copy folder, www.linuxidc.com, but edit files in another place, and then copy the changes in another place directly to the working copy folder, run the commit command to maintain the version. To create your working copy, you only need to use the checkout command:

# Create a working copy named my_working_copy
Svn checkout file: // home/zzm/svn-repo/myproject my_working_copy
(There will be a lot of output based on the number of your files, and the current checkout version will be told to you)

# In fact, you can use the checkout command to obtain all the content of any version of the project. Run the following command:
Svn checkout file: // home/zzm/svn-repo/myproject my_working_copy_version_number-r version_number
(Version_number is the version number of the project you want to obtain, such as 1, 2, or 3)

# If you change the content in your working copy, you need to save this change, that is, add a version to the version library, and run the commit command:
Svn commit-m "I have added several images and updated the project planning"
(Make sure that the current path in your terminal is your working copy path to correctly execute this command)

# After several commit operations, you may have many versions in the version library. You can run the following command to view the version details:
Svn log path
(Path is the working copy path you want to query. If you enter the command below this path, you can omit the path)

----------------------------------
10 million notes:
When you perform file operations in your working copy directory, such as deleting or moving files, you cannot directly use the command rm and mv in the terminal. In this way, svn cannot track file changes, when you use the commit command for submission, you will not get any results. To let svn track your changes, you must use svn del or svn move to delete or move the changes, for example:

# I copied a file to working copy. I need to let svn know that I copied a file:
Svn add filename

# Others:
Svn move filename/home/zzm/my_working_copy/new_folder/aa
Svn rename filename1 filename2
Svn del filename

Almost all of the above is enough for individual users. If you have any questions, please reply and ask.
I hope the above content will help you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.