![]() Even if we don't know about it, we can solve our problems with a combination of commands - normal and interactive rebase, cherry-pick. It is one of the more advanced commands with which we can easily solve certain Git problems with our branches. It seems strange but hopefully, with this article, this will be cleared out and it won't be strange anymore. After all, you are not doing anything and all of a sudden you see some commits in your PR which don't belong there. People were surprised by the changes that they have been seeing in open PRs. ![]() This was a problem that we had for a few months. ![]() #Smartgit rebase branch on top of master how to#If you are not familiar with how to do that, have a look at the previous blog post Some of the most used Git interactive rebase options. Check if there are commits that don't belong in the branch and drop those commits by doing an interactive rebase. However, if you are not feeling ready or you don't want to use it and end up in the described situation above, there is a solution with an interactive rebase. However, it is hard and annoying to check if everything is the same in another branch, and using -onto is the better option here because otherwise, it can lead to a branch with commits that don't belong in it. Git is smart enough and when we use rebase, it is going to/can remove the commits that are with the same set of changes. ![]() Keep in mind that sometimes simple git rebase feature-1 is going to work if f/g/h is the same as f'/g'/h'. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |