简体   繁体   中英

Create svn branch from url of working copy

Using SVN command-line, how can I create a branch from the URL of my current working copy? (NOT from my local working copy, which may have local changes)

Looking for a direct way, without going through "svn info" to get the URL.

How about this?

svn copy ^/@HEAD <Branch URL>

EDIT

As branches, tags, and the trunk are just paths and completely arbitrary in SVN, I don't think you'll be able to accomplish what you're trying to do without getting a little creative (eg outside of a built-in SVN command). To accomplish what I think you want to do, you can use a bash script (assuming Mac/Linux):

#!/bin/bash

CURRENT_URL=$(svn info | grep ^URL | cut -d" " -f2)

svn copy $CURRENT_URL "^/branches/$1"

Usage: svnbranch.sh newbranch

You can just perform

svn copy <URL of existing URI> <New URL>

You can obtain the URL of the existing working copy thanks to "svn info".

The should not exist in the SVN server tree, or you'll in fact create a subdirectory in that URL.

The copy will occur directly on the server. You will in fact directly "Commit" your change, without needing any working copy.

Run `svn help copy' and carefully read its output. I think --revision option might help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM