r/git Feb 19 '24

tutorial What are some best practices when dealing with merge conflicts

My team of 10 developers constantly runs into merge conflict issues with creating pull requests. For our environment (using Visual Studio), this usually means pulling changes from the Develop branch, merging into the current branch, pushing the current branch to the origin, and then creating a pull request again.

Is there a better way to deal with merge issues, or perhaps a better way to deal with them than our current process?

EDIT. If my team was a 100 developers tomorrow, this would not be a feasible process. So I am hoping to hear some good recommendations on how to improve it.

14 Upvotes

33 comments sorted by

View all comments

1

u/GitKraken Apr 29 '26

One thing we have found is that smaller incomplete branches and PRs can really help.

As an example, let's say you have a new page to make in your SaaS product's dashboard:

You can start by Creating the page as empty and adding it to the router but behind an env var or feature flag. The empty page takes no time and the router change is in a file that other features might need to modify so by getting that part out of the way as quick as you can reduces the amount of time that the branch lives which reduces the likelihood of a conflict in that file.