my colleague and I are working on updating the same code file, using separate branches.
We initially branched from master at the same point (say commit A) , and created PRs at the same time.
Now, my colleague managed to merge first to master, bringing the code file to commit B.
My question is what happens if I merge my PR to master?
- will my PR overwrite his work, resulting in commit A + my work?
- will my PR add to his already merged work resulting in commit B + my work?
I should specify that no CONFLICT is displayed on my PR after his merge. I guess that happens because we worked on separate parts of the file:
- he modified rows 100 to 150
- I added new rows 400 to 500 to the file
Should I merge master (commit B) in my branch and then merge my branch to master to be sure nothing gets overwritten?
Hi @Claudiu Argeseanu - welcome to the community.
You can rest assured that Bitbucket or git for that matter will not override changes already merged. Hence it is called a merge and not a write.
Each merge is an atomic operation. Even if you were to write (push) to master git/bitbucket won't let you (unless you use the --force push option).
Hope the helps.
Best, Ulrich
// Izymes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.