keep a branch updated #22307
-
hello, I have a repository where the main code is in the master but i have a few branches with minimal features which i didn’t implemented yet in the master branch. How could I maintain these branch updated with the newer code inside master? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @aster94, You can merge the master into the branch or cherry-pick the commits that you want in these branches. Merge solution From github web interface you can click in the “new pull request” button and choose to merge master into one of your active branch. When you merge the master into the other branch remember that all the changes made on master will be made even on that branch. Cherry-pick solution You can find all the documentation of cherry-pick here: git-cherry-pick Get the commit ID of the commit you want on the branch. You can get the commit id by the web UI: Or with command line:
with output:
Copy this value and run the cherry-pick command with the commit ID you have copied (you need to be in the branch where you want this changes):
And this is it. Hope this helps 🙂 -Gabriele-
|
Beta Was this translation helpful? Give feedback.
-
The merge solution is problably what would fit better my needs, but I am also tto lazy to merge every time master inside the branches 😁 When i would be ready to merge the new features inside master i would use the cherry-pick 👍 grazie Gabriele! |
Beta Was this translation helpful? Give feedback.
Hi @aster94,
You can merge the master into the branch or cherry-pick the commits that you want in these branches.
Merge solution
From github web interface you can click in the “new pull request” button and choose to merge master into one of your active branch.
When you merge the master into the other branch remember that all the changes made on master will be made even on that branch.
Cherry-pick solution
You can find all the documentation of cherry-pick here: git-cherry-pick
Get the commit ID of the commit you want on the branch.
You can get the commit id by the web UI:
Or with comman…