8/28/2023 0 Comments Git rebase fast forwardgit merge -s ours feature/feature-1-old Merging two feature branches with git merge strategy 'ours' In this way, you can preserve the history of a branch without considering its effects. The contents of your branch will remain unchanged, and the next time you merge from the other branch, Git will only consider changes made from that point on. This strategy discards all changes from the other branch. git merge -s octopus feature/feature-1 feature/feature-2 Merging two branches with git merge strategy 'octopus' It is the standard strategy for merging multiple branches at the same time. The Octopus merge strategy is used to bundle branches. Octopus (default strategy with more than two branches) There are other types of explicit git merge strategies. Other types of explicit git merge strategies With this merge strategy, Git recurses over the branch commits and creates a new merge commit. To merge your feature branch into the main branch with an explicit merge strategy, you must check out the main branch and merge it into the main branch without the Fast Forward option. Git commit -m "tbd" Merging a feature branch with git merge strategy 'recursive' git checkout -b feature/feature-1Īfter you have committed your work on the feature branch, you want to bring your feature onto the main branch. Suppose you are working on a feature branch. It is explicit because it creates a new merge commit that extends the Git history to indicate that a merge has been invoked. The explicit Git merge strategy is the default merge strategy. Let us look at the differences between explicit merge strategy using git merge -no-ff and implicit merge strategy using git rebase and git merge□ Explicit git merge strategy (git merge -no-ff) I have seen many development teams use an explicit merge strategy at this point, resulting in separate merge commits.īut what are the differences between an explicit merge strategy and an implicit merge strategy? How does the feature get into the main branch? So on the way to a new feature, there may be a lot of commits. How do you keep the Git history clean when there are a number of commits on the feature branch and you want to bring them into the main branch?Īs a developer, you do not want to think about how to split commits. How do you get your feature into the main branch?įrom this scenario, the following questions arise for me: The developers work on the specified feature branches for the new features, resulting in multiple commits. For each new feature, the team creates a feature branch. Let us assume that you distinguish between the main branch and the feature branches in your team. Source: Stackoverflow How do you bring your feature branches into the main branch?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |