We are a team where we branch off from a WorkInProgress
branch, to our own branch and all our work gets "dumped" into WorkInProgress
.
When a dev is done with some work/feature, they commit to their branch and push to their remote. Then, they do "Pull Request" remotely from their branch to the remote WorkInProgress
.
We have been doing this for a long time. Today, we want to "sync". So for example myself, I want to get all the developers' work from WorkInProgress
branch, into my branch.
Would Git know the changes that are common (WorkInProgress
has commits from my branch already) and exclude them when "merging back" to my branch?
How do I "update" my branch properly?
WorkInProgress
branch (git fetch origin WorkInProgress:WorkInProgress
)git checkout OwnBranch
)WorkInProgress
branch into your own branch (git merge WorkInProgress
), you may have to resolve conflicts.When you later make the pull request to merge your branch back in, git will correctly identify where to start comparing the branches from and which commits it needs to put in.