I want to rebase a feature branch from develop. I am using PhpStorm Git integration and I have 2 different develop branches:
refs/remotes/origin/develop refs/heads/develop
In order to do not mess up things, which one do I have to choose to rebase?
Luckily, using git reflog you can get the reflog of the remote branch. On the remote branch's reflog you can find a ref before it was rebased. You can then rebase your branch against that remote ref using the --onto option as discussed above in the Advanced Rebase Application section.
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.
I don't know the phpstorm interface for Git, but in the command line I'd do the following:
git checkout develop
git pull origin develop
-> this fetches the remote version of the develop branch and merges it (or rebases it, depending on your pull strategy) into/onto your local branch. This way the local and the remote versions of develop are the samegit checkout feature-brach
git rebase develop
If there are any conflicts - resolve them. After that you can create a pull request against develop
.
When you are at your branch, where you have committed changes: Do the following:
git fetch
git rebase origin/develop
In case of any conflicts, please fix them. Then,git add .
git rebase --continue
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