ErgoEmacsEmacsLispBlogEmacsLispBuy Tutorial
Web Hosting by 1&1
32.1.8.2 Creating New Branches

To create a new branch from a head revision (one that is the latest in the branch that contains it), first select that revision if necessary, lock it with C-x v v, and make whatever changes you want. Then, when you commit the changes, use C-u C-x v v. This lets you specify the revision ID for the new revision. You should specify a suitable branch ID for a branch starting at the current revision. For example, if the current revision is 2.5, the branch ID should be 2.5.1, 2.5.2, and so on, depending on the number of existing branches at that point.

To create a new branch at an older revision (one that is no longer the head of a branch), first select that revision (see Switching Branches). Your procedure will then differ depending on whether you are using a locking or merging-based VCS.

On a locking VCS, you will need to lock the old revision branch with C-x v v. You'll be asked to confirm, when you lock the old revision, that you really mean to create a new branch—if you say no, you'll be offered a chance to lock the latest revision instead. On a merging-based VCS you will skip this step.

Then make your changes and type C-x v v again to commit a new revision. This automatically creates a new branch starting from the selected revision. You need not specially request a new branch, because that's the only way to add a new revision at a point that is not the head of a branch.

After the branch is created, you “stay” on it. That means that subsequent check-ins create new revisions on that branch. To leave the branch, you must explicitly select a different revision with C-u C-x v v. To transfer changes from one branch to another, use the merge command, described in the next section.

blog comments powered by Disqus