I have a project which uses git and I'd like to start a new branch to add a major new feature.
Under the main
branch, I'll continue to add bug fixes and minor features. At regular intervals I'd like to pull the changes from the main branch into my "major new feature" branch. What's the best way to do this?
Eventually, I'll merge the "major new feature" branch into the main branch.
Do a checkout from your current branch and pull from another branch. This pulls all the commits from the other branch into the current branch. You can work on all the changes without changes being committed to actual branch. Optionally you can commit and push if these changes needs to be tracked.
In Git, there are two main ways to integrate changes from one branch into another: the merge and the rebase .
git checkout featurebranch && git rebase master
As long as you haven't pushed yet, it is better to replay your changes on top of master.
See:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With