SVN Checkout without URL on CLI

0

So I used the svn CLI client for the first time today, after having exclusively used TortoiseSVN so far (i.e. for a few years).

The one thing that bugs me is having to provide the repo URL for every checkout. Is there any way to have SVN look it up itself and only checkout the current directory/sub-branch of the tree (i.e. similar to how TortoiseSVN does it)?

Is there any point to having to provide the repository URL every time upon checkout? It's not necessary to provide it for commits and svn info will print it out anyways .. so why does checkout demand it to be provided every time?

BVN

Posted 2015-10-19T18:21:12.773

Reputation: 3

Answers

2

You don't have to checkout every time. Checkout command is aimed to be used the first time you retrieve the project.

Then the only thing you have to do is go inside your project root folder and type svn update.

labilbe

Posted 2015-10-19T18:21:12.773

Reputation: 140

0

Back when we were using SVN here, I had a fairly complex svn() function. You could start with:

svn() {
    local subcommand=$1
    shift
    case $subcommand in
        checkout|co) 
            local module=$1
            shift
            local url="http://example.com/svn/$module/trunk"
            command svn checkout "$url" ./"$module" "$@"
            ;;
        *)  command svn "$subcommand" "$@" ;;
    esac
}

Add that to your ~/.bashrc, and source ~/.bashrc. Then you'd just do

svn co mymodule

instead of

svn co http://example.com/svn/mymodule/trunk

Any other SVN command is run without modification.

glenn jackman

Posted 2015-10-19T18:21:12.773

Reputation: 18 546