Ubuntu, using SVN from Terminal

Source: Internet
Author: User
Tags svn client

Hello everybody,

One day I had problems with GUI SVN client and a big headache how to commit my changes. I have found how to do that using terminal and from that moment I'm not using any single GUI SVN client :))

1. Getting SVN sources from the svn Repository:
-- Go to the folder you want To make you project's folder and Type A simple command:

~ $ SVN Co 'here address of SVN repo'

Emaple: SVN Co https://crossfire.svn.sourceforge.net/svnroot/crossfire
If SVN is not installed, just type:

~ $ Sudo apt-Get install Subversion

-- Nano editor is needed for adding comments

~ $ Sudo apt-Get install nano

2. Updating sources from the svn:
-- Go To The your project's root directory, example:/home/yahor/projects/some_project/trunk <--- and then there are going project structure, so trunk is a root project's folder, then type:

~ $ SVN up

-- Yep, only 2 words :))

3. Adding/removing files and directories into SVN:
-- A) go to the root Dir of the project or B) Go to the file via all folders, So if you type 'LS' you will see this file
A1 )~ $ SVN add ~ /Projects/some_project/some_folder/some_file_to_add.java
A2-you are in the root proj DIR )~ $ SVN add some_folder/some_file_to_add.java
B-you in the file's dir )~ $ SVN add some_file_to_add.java
To remove files, change 'add' in the command to 'delete ':)
-- After you have added/deleted the file, you need to do a commit to apply changes!

4. Committing added/deleted/modified files:
-- Single file choosing logic is same as for Delete and add, just another command is used
-- If you want to commit program files, just list them after 'cies' using space between file paths
-- If you want to commit all changes, just type 'snv cies' like 'svn up'

~ $ Svn ci file_to_commit.java
~ $ Svn ci file_to_commit.java file_to_commit2.java
~ $ SVN Ci

-- After you will hit the enter, you will see nano Editor (SUDO apt-Get install nano) text enter area for commit comment, and list of files you are going to commit. to complete commit do following:
1. Enter comment;
2. hit Ctrl + X;
3. Confirm changes 'y ';
4. Hit enter;
5. Enjoy :)

5. SVN status or how to check the state of the project
It is very simple to check what files are modified, added or removed:
-- Type A command in the project's root folder and it will list all modified files
-- Then you can type 'svn cies' and copy using clipboard all files you want to commit delimiting them by space!

~ $ SVN status

6. Revert your current working copy revision to the previous or custom Revision:

~ $ SVN up-r revision_number

7. Get revisions history:

~ $ SVN log

8. Do not hesitate to use grep (use man grep to find more info) for searching necessary modifications in the project:
(Show only modified files)

~ $ SVN st | grep ^ m .*


Very simple and useful.

Happy subversioning (:

Best regards,
Yahor

 

Via: http://blog.softteco.com/2011/02/ubuntu-using-svn-from-terminal.html

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.