I want my local master branch to include the commit 'fixed js errors' and be rebased into origin/master.
I started the process like this:
Which leads me to this:
But as you can see, I'm asked to pull before I push. And every time I pull I end up with a situation depicted in the first image. What am I doing wrong?! Thanks,
The Rebase Option This moves the entire feature branch to begin on the tip of the main branch, effectively incorporating all of the new commits in main . But, instead of using a merge commit, rebasing re-writes the project history by creating brand new commits for each commit in the original branch.
To rebase, make sure you have all the commits you want in the rebase in your master branch. Check out the branch you want to rebase and type git rebase master (where master is the branch you want to rebase on).
It is used to apply a sequence of commits from distinct branches into a final commit. It is an alternative of git merge command. It is a linear process of merging. In Git, the term rebase is referred to as the process of moving or combining a sequence of commits to a new base commit.
Your original structure would not support rebasing. Let's say you had a commit to your local master
and someone else had committed (and pushed) another change to origin/master
. In this scenario, you could rebase your commit on top of the other commits.
Your scenario has a commit from a completely different branch. You would either need to merge your other branch into master
, or you could cherry pick that one commit and apply to the master
branch.
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