Routine Use of svn in linux

Source: Internet
Author: User
Tags tortoisesvn
Routine Use of svn in linux-general Linux technology-Linux technology and application information. The following is a detailed description. First, download the subversion package in linux. For Debian, use sudo apt-get install subversion. For other releases, refer to the corresponding Package Manager. Rapidsvn is a good choice if you don't want to use a text interface. Completely graphical

Next, it is similar to TortoiseSVN I wrote.

Use svn checkout-N https: // https://i18n-zh.googlecode.com/svn/trunk/ first

This will generate a directory named "trunk" under the current directory. The-N option tells svn to retrieve only the top-level files without directories. In this way, we get a normal working directory (working copy) that can be operated locally. If you have the svn upload permission on the server above, enter the password and user name. If not, change the https address to http. For more information about how to apply for an upload account, see the description here.

Next, go to the "trunk" directory. Create a file.
Cd trunk
Mkdir test # create a test directory
Vi test.txt
Just write something

After all the preceding steps are completed, return to the trunk directory and check it with svn stat. You will find that there is one in front of the newly created item "? ". This indicates that these files are not under Version Control of svn. So you need to add them and use the command

Svn add *

Now you should see the output. All files are preceded by A "A", which indicates that A new file is added.

Finally, upload it. Run the svn commit command in the trunk directory. It will automatically find the file to be uploaded. Before uploading, you will start your editor and ask you to write something, that is, update instructions. It is best to write it, otherwise something like a) bort c) ontinue will appear. Of course, you can select continue, but there is no explanation for this operation in the record on the server. If you want to checkout this version, you will not know what changes have been made to this version.

Okay. So much content. It looks a little simpler than tortoisesvn in win. Another point is that some of the above commands are abbreviated. For example, you can write svn checkout as svn co and svn commit as svn ci. After installing svn, you can use svn help. It should be said that svn's help is well written. Simple and practical! I learned how to operate svn.

This is my operation.
Cd myworkplace
Svn co $ repo/fetchmail fetchmail-6.3.8 # Fetch fetchmail and rename it fetchmail with version number
Editing & save fetchmail-6.3.8/fetchmail-6.3.8.zh_CN.po

Mkdir latrin # create latrin
Mv ~ /Desktop/latrin-0.10.0.pot latrin/# Put the downloaded pot under latrin
Cd latrin/
Msginit-l zh_CN.utf8 # generate a utf8 encoded zh_CN.po and prepare the translation
Mv zh_CN latrin-0.10.0.zh_CN.po # rename. You can use sendpo. sh to upload data to tp-robot later.
Edit & save latrin-0.10.0.zh_CN.po # Work

Cd .. # Return to myworkplace
Svn add * # add everything you just created
Svn ci # submit all modifications made today

For daily use, only co and ci are required. The command above is always required when a new project is created. There are a lot of commands, but every time there is a pattern, so well, haha. I wrote a script

#! /Bin/bash
# Filename: genpo. sh
Echo-n "Enter a directory name :"
Read d_name
Mkdir $ {d_name}
Mv $ 1.pot $ {d_name}
Cd $ {d_name}
Msginit-l zh_CN.utf8
Mv zh_CN.po $1. zh_CN.po
Cd ..
Svn add $ {d_name}
Vi ${d_name}/$1. zh_CN.po

In this way, the downloaded pot will be placed in the myworkplace directory. Use genpo. sh file name-version number without suffix. pot. After editing, svn ci is OK.
Related Article

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.