Reputation: 109
What is the best way to resolve the automatic merging conflicts.
This is the scenario
I think the issue is since I amend the last commit to the previous, it identify as one commit. My master has commit which I made earlier.
Could someone tell me what is the best approach to resolve this.
Upvotes: 0
Views: 2115
Reputation: 359
If you using Visual Studio 2022, then follow these steps :
Open window 'git changes'.
On list branch, found your destination branch (in your case Master, in my case dev). Right click and select 'merge into current branch' Viola, you will see list of file you commited separated in two groups. One group is file that has no-conflict (staged) and the other is the one that has conflict (unstaged).
In my case I only need to stage all file that unstaged (hence in conflict). Depending on your condition, maybe you need to fix before staged all unstaged file.
If all unstaged file hasbeen staged or deleted, then Sync.
Problem should be fixed.
Upvotes: 1
Reputation:
You should probably create a new commit that addresses the findings from the second review and a new PR for it. Both commits will remain in the git history.
Other options include:
For the future I'd recommend not amending commits after other develpoers have had access to them (after pushing/merging them onto shared branches, ...) because this can cause such issues.
Also reviews should generally be done before merging things into a master branch.
Upvotes: 1