0

So I just recently pushed a branch up as follows featureBranch -> Dev -> Main -> MainProd. I made sure all the branches were up to date by pulling down the latest from orgin.

However, when I git diff Dev...Main for example its telling me there are multiple differences with 5 different files. If I look at those files using git checkout Dev and then checkout Main, all of those files are synced and exactly the same on both branches. Also, if I git diff between any two of Dev, Main, and Main-Prod it says the same thing for each one with the same 5 files. Any idea how to fix this? Thanks!

PS. were using pull requests to merge code and azure dev ops. Main and Main-Prod can only have code merged in via pull requests. I read somewhere this could be a result of a squash commit?

  • 3
    It's possible for `git diff Dev...Main` to show changes that aren't there when you use just 2 dots or no dots, or checkout the 2 branches. Does `git diff Dev Main` show any changes for those 5 files? (I'm guessing not.) I think you probably meant to use either 2 dots or no dots (they're the same result). Using 3 dots gives you the diff between the merge base and `Main`, which isn't what you want here, apparently. – TTT Dec 06 '22 at 20:44
  • You're right. When I use 2 dots or no dots it returns nothing vs when i use 3 dots. However, when I make a PR in azure devops, it still shows those files as changed. The same files as 3 dots shows. Couldn't this cause merge conflicts in the future? Not quite sure how to resolve this. – theCodingPro Dec 07 '22 at 15:02
  • Are `Dev`, `Main`, and `MainProd` long lived branches that are never reset? And is it possible to get code into `Main` in another way besides merging `Dev` into `Main`? (Because that might explain how you ended up in your current situation, with similar changes on both `Dev` and `Main` but from different commits.) – TTT Dec 07 '22 at 17:45
  • Dev, Main, And MainProd are long lived branches. Not sure what you mean by reset. Another alternative: for example, if we wanted to merge Dev into Main with Dev having recent changes, we could create a branch off Dev called "DevIntoMain", rebase that branch with Main, then PR it into Main. Does this sound reasonable? Thanks! – theCodingPro Dec 07 '22 at 19:20

0 Answers0