Mantain old releases without creating long-lived branches

I am new to Git.

I read: "Pro Git: Maintaining a Project" (book) and also Git: Documentation / howto / maintain - git.txt

The tough question for me is: how to store old versions without creating separate long-lived branches. In other words, I am wondering how to work with the "maint" branch in a Git project.

In the example (merging with theme branches and integration of patch contributors are not shown, other branches "next", "pu" are also not shown here).

These images can also be viewed here .

+--master | +--maint | (c1)->(c2) | +--tag : feature-release v1.0 

Next:

 tag:feature-rel v1.0--+ +--master | | (c1)->(c2)->(c)->(c)->(c)->(c) | +->(c)->(c)->(c) | +--maint | +--tag:maint-rel v1.0.1 

Next, as described in "maintain-git.txt", run:

  $ git checkout master $ git merge maint 

Result:

 tag:feature-rel v1.0--+ +--master | | (c1)->(c2)->(c)->(c)->(c)->(c)->(c100) | / +->(c)->(c)->(c50)-----' | +--maint | +--tag:maint-rel v1.0.1 

Next:

  +--master | +--tag:feature-rel v2.0 | ...->(c)->(c100)->(c101)->(c102) / ...->(c50)---' | +--maint | +--tag:maint-rel v1.0.1 

And at the moment I have a few questions:

  • What to do with the "maint" branch? I understand that the "maint" pointer should be moved in the same position as the "master"? How?
  • Then how to make a fork of the "maint" branch from the "master" branch?
  • If a patch appears (the last very long time, for example, the current release version v10.0) for the old "tag: maint-rel v1.0.1", how to integrate it into "maint" and in the "host"?

Thanks.

+6
git branch maintenance
source share
1 answer

how to execute old versions without creating separate long-lived branches

Maintenance sections are often run for release and are long lasting, since they serve to correct errors specific to this version, and not everything should be integrated into the current development.

1 / What to do with the "maint" branch? I understand that the "maint" pointer should be moved in the same position as the "master"? How?

I am not sure why you will reuse maint here. rebase will not work.
May be

 $ git checkout maint $ git reset --merge c102 

Since "maint" has already been merged with master, I think this reset would not update any of the new files in master.

I just tested it:

alt text http://img188.imageshack.us/img188/4425/resetmerge.png

It moves HEAD from "maint" without touching files in master.

2 / After that, how to make a fork of the "maint" branch from the "master" branch?

Well, reset would move the head of "maint" to the current development: if C102 is v2, all you need to do is check "maint" and you will immediately unlock it.

This will give you:

alt text http://img36.imageshack.us/img36/91/resetmerge2.png

3 / if a patch appears (the last very long time, for example, the current release v10.0) for the old "tag: maint-rel v1.0.1", how to integrate it into "maint" and in the "host"?

There you need to create a "named service branch":

 $ git checkout -b maint-1.0 c50 $ # work on patch $ git checkout maint $ git cherry-pick ... # only merge what you need in maint $ git checkout master $ git cherry-pick ... # only merge what you need in maint 

Note. You might want to not combine the same thing in maint (which may still need some part of the fix made in maint-1.0) and master (which may have changed so much that most of the patch is no longer relevant)

+3
source share

All Articles