Creating a branch to release snapshots?

I have a git repository. I want to create a branch for release snapshots. Will work as follows:

  • Currently working in my regular branch with the name "foo".
  • Create a branch (once) called "release".
  • Work a little on foo, making changes, etc.
  • Ready to release the application, push all changes with foo to release.
  • Repeat steps 3 and 4 from now on.

The purpose of the β€œrelease” is to preserve the state of the code for the last public release. If I find an error a week after release, I could pull out this snapshot, patch and re-release.

Is there any other mechanism for this? I come from subversion and wincvs, so any advice would be great.

thanks

+4
source share
3 answers

Another way to do this is by tagging. Work in any branch that you like, and when you are ready to release only the current head tag.

git tag MyProject_1_0 

You can then refer to changes from this point at any time.

 git checkout MyProject_1_0 

Note. When you click on your deleted tags, the default will not be clicked. You need to use the --tags option to click on the newly created tag so that other users can download it later.

+1
source

You're on the right track, but I highly recommend the git workflow approach described here http://nvie.com/posts/a-successful-git-branching-model/ .
It formalizes the use of branches, such as release, patch, and tag wizard.
There are even tools written specifically for this method: https://github.com/nvie/gitflow/tree/feature/python-rewrite

+2
source

I would use a tag, as Jared says, but use an annotated tag by specifying the git tag flag -a . This gives the SHA tag the ability to add some notes to the tag, as well as sign it.

This ensures that the tagName - SHA:abcd1234 tag tagName - SHA:abcd1234 comes from this exact commit.

0
source

All Articles