Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a branch?

How do I create a branch in SVN?

like image 421
sparkes Avatar asked Aug 05 '08 09:08

sparkes


People also ask

Where can I create a branch?

The easiest way to create a Git branch is to use the “git checkout” command with the “-b” option for a new branch. Next, you just have to specify the name for the branch you want to create. To achieve that, you will run the “git checkout” command with the “-b” option and add “feature” as the branch name.

How do I create a new branch in git branch?

Now choose your child branch as from branch and enter the name of your new branch. -> GrandChildBranch and so on. You can create any new branch from any existing branch, tag, commit, etc. Hope it will help.

How do I manually create a branch in git?

To create a new Git branch in GitKraken, you will simply right-click on any branch or commit and select Create branch here . ProTip: GitKraken will automatically checkout the branch for you immediately after the branch has been created, so you can get straight to work on the right file.


2 Answers

Create a new branch using the svn copy command as follows:

$ svn copy svn+ssh://host.example.com/repos/project/trunk \            svn+ssh://host.example.com/repos/project/branches/NAME_OF_BRANCH \       -m "Creating a branch of project" 
like image 183
sparkes Avatar answered Sep 28 '22 13:09

sparkes


Branching in Subversion is facilitated by a very very light and efficient copying facility.

Branching and tagging are effectively the same. Just copy a whole folder in the repository to somewhere else in the repository using the svn copy command.

Basically this means that it is by convention what copying a folder means - whether it be a backup, tag, branch or whatever. Depending upon how you want to think about things (normally depending upon which SCM tool you have used in the past) you need to set up a folder structure within your repository to support your style.

Common styles are to have a bunch of folders at the top of your repository called tags, branches, trunk, etc. - that allows you to copy your whole trunk (or sub-sets) into the tags and/or branches folders. If you have more than one project you might want to replicate this kind of structure under each project:

It can take a while to get used to the concept - but it works - just make sure you (and your team) are clear on the conventions that you are going to use. It is also a good idea to have a good naming convention - something that tells you why the branch/tag was made and whether it is still appropriate - consider ways of archiving branches that are obsolete.

like image 22
Ronnie Avatar answered Sep 28 '22 13:09

Ronnie