Skip to content

Instantly share code, notes, and snippets.

@jorgemarsal
Last active August 29, 2015 14:16
Show Gist options
  • Save jorgemarsal/6a93e53d2339e7c67d5c to your computer and use it in GitHub Desktop.
Save jorgemarsal/6a93e53d2339e7c67d5c to your computer and use it in GitHub Desktop.

This is one possible flow for backporting fixes to old branches.

Let's say we want to backport commit f54200217d57c64bdeac93192aa3ff9fc53d5890 to branch DistR-1_0_x.

First we create a local Distr-1_0_x branch:

$ git checkout -b DistR-1_0_x remotes/origin/DistR-1_0_x

Then we backport the commit with git cherry-pick:

$ git cherry-pick f54200217d57c64bdeac93192aa3ff9fc53d5890

Finally we commit the changes and push to the repo:

$ git commit -a
$ git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment