0

I'm currently trying figure out Trunk Based Development with another team member:

Both of us are pushing directly to origin/master

When my teammate pushes, the repo in VSCode's Source Control Repositories will indicate I can Pull 1 commits from origin/master

Assuming we have modified the same file, clicking on the indicator will pop up a message: Please clean your repository working tree before checkout.

Right now, it's cumbersome as I have to stash away my changes, pull and then pop the stash etc and I'm not even certain if I lost any changes

My main question here is, how can I bring up the Merge Conflict Editor to deal with this. I tried googling, but wasn't able to find out how this could be done

Any ideas?

starball
  • 20,030
  • 7
  • 43
  • 238
bilogic
  • 449
  • 3
  • 18
  • Something like [Pull (rebase)](https://stackoverflow.com/a/52235380/7034621) should help. – orhtej2 Mar 20 '23 at 13:43
  • Thanks! That finally brought up the Merge Conflict Editor. Let's say in step 3, my teammate modified the same file as me + added another file. It seems weird that VSCode attributes the new file to me. Is there a way to recognize all my teammate's changes, then use the merge editor to merge in my changes? – bilogic Mar 20 '23 at 13:53
  • I thought that's what Pull (rebase) will do, re-apply all your changes on top of the latest revision from upstream (`origin/master` I assume). Are you sure you're not stuck in some rebase limbo? After resolving the conflicts you probably need to `Git: rebase (continue)`. – orhtej2 Mar 20 '23 at 13:56
  • 1
    @orhtej2 yes, my bad. It is behaving as I want it now. Thank you!! – bilogic Mar 20 '23 at 14:02
  • Possibly related: https://stackoverflow.com/q/67624690/11107541 – starball Mar 20 '23 at 18:38

1 Answers1

0

The (better) way I wanted to handle the conflict is known as Pull (Rebase) as mentioned by @orhtej2 (Thanks!), meaning, pulling down all the changes from origin/master and rebasing our changes on top of it

Assuming that the origin/master is ahead of me, the exact steps would be as follows:

  1. Commit my changes locally first
  2. Source Control in VSCode will display the button Sync changes 1⬇ 1⬆
  3. Go to the of Source Control and click on Pull (Rebase)
  4. Source Control will list out the files that it does not know how to handle
  5. Clicking on any of the files will bring it up with the option to use the Merge Conflict Editor
  6. When all files are deconflicted (merged), go to Source Control and click on Continue
  7. That will push your deconflicted files to the origin/master
bilogic
  • 449
  • 3
  • 18