Problem occurs when codes are conflict.
As you see in image given above that four options are there
I want to know the difference between Accept Current changes
and Accept Incoming changes
Git : accept all incoming changes In the case that you wish accept all incoming changes in the branch, you can cd to the repository and run git against the current directory. (awesome-new-feature) git checkout --theirs .
The only way to "accept both" would be to just re-stage (marking as resolved) the conflicted files without resolving them ( >>> and <<< would be there still), but your result couldnt be compiled or executed. And this is terrible practice, even if you make commits later to resolve.
Its very easy just go to vs code and press Ctrl + shift + p (command palette) or go to view and open command palette manually and type "merge" in your command palette, now you can see the Accept all current changes.
Merge the incoming changes into the current branch: select this option to perform merge during the update. This is equivalent to running git fetch and then git merge , or git pull --no-rebase . Rebase the current branch on top of the incoming changes: select this option to perform rebase during the update.
It depends on the type of operation (merge or rebase) leading to that conflict.
In your case, a merge, where:
Then:
Don't forget, in case of a rebase, "what you have" and "what you merge" are reversed.
If it's a conflict due to a rebase, you could always imagine like so -
Now, if you see from the point of view of master -
incoming changes
are the ones that move to master (i.e. changes in your feature branch), hence the term.
current changes
are the ones that are already present in master (i.e. ones done by fellow developers or yourself on master).
In case of merge conflicts, as suggested by @VonC, the terminology is reversed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With