Why my develop to staging PR have conflicts again and again

Ka
1 min readMay 21, 2022

I have a personal project on github, it have master, staging, develop branches. Everytime, I create new branch based on develop, implements features or bug fix, commits frequently as I want.

When create PR to develop, I squash the PR to make the commits clean, works good. (Have a cup of coffee).

After testing, it is time to cut to staging, ok, create a PR from develop to staging, but, there are conflicts! It happen again…

What’s wrong, I remember it always have this problem, sometimes I even tried delete staging and recreate based on develop from scratch, but after a while, it happen again, PR from develop to staging have conflicts.

Finally I found the cause, it is simple but you are easy to overlook, each time I create PR from develop to staging, I use squash, this makes the staging actually different than develop, so next time it will have conflicts when create PR from develop.

Conclusion

You can use squash when create PR to a branch B your current branch A is based on(branch B). But you should not squash when you create PR to branch C from branch B as branch B is not based on branch C.

Originally published at https://blog.kazge.com on May 21, 2022.

--

--

Ka

Ka is a veteran have more than 15 years of experience in software industry with a passion. He love reading and writing. He is looking for a remote position.