Question: I use a version control system (formerly subversion, now git) to write papers, which for me works very well and is convenient. A few times, I even worked with branches for different logical versions of a paper, such as versions submitted to different journals. However, I found branching of little use for paper writing. When I used different branches for different journal submissions, I found myself working only on the "latest" branch anyway, since I can anyway only submit one version per time, and, if it is rejected, will not continue to work on that particular version at a later time. I didn't find any other good use of branching in paper writing, and later skipped it completely.

Is there any advantage of working with several branches when writing a paper with a version control system? How should one organize the writing process in order to profit from such an advantage?

Answer: 
In principle, branches seem like a good idea. A potential use case would be:

* working on a draft of a paper
* as we get close to the conference deadline, putting the paper in the conference format and reducing to the prescribed size
* finding typos in this version and fixing them
* merging the typos back into the "main version"

In practice, I've never done this, because I'm not organized enough. Also, svn is not as friendly to this workflow as git is, for other reasons.
An alternative to branching in some cases, especially for short lived branches like for journal submission, is using patch queues. Mercurial has `mq`. I believe Git has similar things, but I'm not a git user.

As the question says:

> 
> When I used different branches for different journal submissions, 
>  I found myself working only on the "latest" branch anyway, since I can
>  anyway only submit one version per time, and, if it is rejected, will
>  not continue to work on that particular version at a later time.
> 
> 
> 

I have had similar experiences when using different (named) branches for submission to different journals. The problem is that one ends up having dead branches which correspond to journals the paper was rejected from, or perhaps journals you never ended up applying to. These live forever in history, which is annoying and sub-optimal.

The advantage of using patches, at least with `mq`, is that one can maintain multiple patch queues, each of these can be managed as a distinct mercurial repository, and they do not become part of the main repository's history unless you want them to, though of course you can push them to remote since they are regular repositories. Also, one can use them with general non-vcs tools like `patch` and `quilt`, which is occasionally useful.

However, when applied, these patch queues are a bona-fide part of a mercurial repository, and can be treated as (anonymous) branches. So, suppose one has two patch queues `Q1` and `Q2`. Then if wants to work with both versions simultaneously, one can make a clone of the main repository, thus resulting in two identical copies of the repository. Then one can apply Q1 and Q2 to the copies, and then work with them as one would with regular branches, using mercurial's merge machinery and so forth.

Another use of patch queues which is very useful, and not specific to paper writing, is to queue up small changes in the queue till one is ready to commit them. I usually just stick everything in one patch, though one could divide the changes into multiple patches. Then, when one is ready to apply some or all of the changes, one can do

```
hg qref -X .   # apply the patch as local changes, making the patch empty
hg qpop --keep-changes  # pop the patch

```

This results in 

a) the patch being applied as local changes to the working directory

and

b) the mercurial queue patch becoming empty and being removed (popped) from the repository.

Since the patch is now local changes to the working directory, we can easily commit what parts of it we please. When done one can resync the patch with

```
hg qpush --keep-changes    # push the patch back onto the repository
hg qref                    # put the local changes back into the patch
hg ci --mq                 # commit the changed patch (to the mq repository)

```

Then the patch is recreated with the portions of the local changes that were not committed.

See the loosely related questions [What's the Git approach to publish a patch queue?](https://stackoverflow.com/q/5016862/350713) and [git equivalent to hg mq?](https://stackoverflow.com/q/952651/350713).