Sync git branches after migration from tfvc

36 views Asked by At

How can I sync branches after migration from tfvc so that ahead|behind is 0|0?

The branches are identical in contents but with different history.

We are using Azure DevOps.

git merge syncs up the branches perfectly but also merges in all the commits which is not optimal.

git merge --squash results in nothing to commit and push.

Suggestions?

enter image description here

1

There are 1 answers

2
Philippe On

When you are only ahead, syncing a branch is end up to only doing a push.

When you are ahead and behind and you don't mind loosing the commits already pushed in the remote (the behind ones), you need to force push.

I don't know exactly where this option is in Visual Studio (and I'm not in front of my computer ) but from the command line, it should be (if your remote is origin which is most of the times the case) :

git push --force origin dev

Same for your other branches like 'test'.