![]() What do you notice here? The remote testing branch and local testing branch are now in different states. It doesn't contain new changes on main that are made afterwards. But that's not the case with the local testing branch right?īecause I didn't rebase locally, the local branch only contains changes from main which existed before the branch was created. The remote branch now contains the new changes made on main. So here is where the git history of the new branch on remote becomes out of sync with the local branch.īy rebasing on the GitLab UI (which I had to do as there were new changes on main) before merging, the state of the remote testing branch changes. I can easily perform a rebase on the GitLab UI (without having to do that locally) so that my merge can be successful. And when that works successfully, testing would contain all the changes in main (with the new changes added on top), and a fast-forward merge would work. ![]() So if I have already made new changes on main since the time testing was created, a fast-forward merge for testing to main won't work.įor a fast-forward merge to work, I'd have to rebase testing with main. Instead, I use the fast-forward merge which adds only the commits made in the branch I want to merge, without including a "merge commit".īut fast-forwards are only possible if the branch I want to merge (let's call it testing) contains all changes in the target branch (let's call it main). My setup is like this: for merge requests, I don't do the regular merging which adds a new commit when a branch is merged with another branch. ![]() I experienced this while using a "rebase and fast-forward" merge approach. If this happened before the remote branch was merged, git would be unable to tell if the branch has been merged locally. Something might have happened to the branch on remote which didn't happen locally, and that would put the branches out of sync. What makes the state of a local branch different from its remote counterpart? Remote branch history conflicts with local branch history What I discovered (hours later) was that the state of the local branches were not in sync with the state of the remote branches when the remote branches were merged. But when I ran git branch -merged, I didn't see the list of local branches which I expected.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |