8/25/2023 0 Comments Rebase branch with masterOnce we solve the conflicts, or if there is no conflict, we commit and push them git commit -m 'merge test branch'īut this way will lose the changes history logged in test branch, and it would make master branch to be hard for other developers to understand the history of the project. If conflict is encountered, we can run git status to check details about the conflicts and try to solve git status Test merge before commit, avoid a fast-forward commit by -no-ff, So, when we suspect there would some conflicts, we can have following git operations: git checkout test It would "squeeze" all test commits into one merge commit on master that is to say on master branch, we can't see the all change logs of test branch. It's unsafe, because we don't know if there are any conflicts between test branch and master branch. This is a very practical question, but all the answers above are not practical. The goal in all of this is to keep my test branch updated with the things happening in master and later I could merge them back into master hoping to keep the timeline as linear as possible. Question 2: Which one of these two methods is right? What is the difference there? I am not using -rebase because from my understanding, rebase will get the changes from master and stack mine on top of that hence it could overwrite changes other people made. My work on test is done and I am ready to merge it back to master. Question 1: Is this the right approach? Other developers could have easily worked on same files as I have worked btw. I would do git pull origin master from test. Let's say work on test is taking several days and you want to continuously keep test updated with commits inside master. There are several developers who either commit to master or create other branches and later merge into master. A new branch from master is created, we call it test.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |