Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell git to accept all current change

Tags:

git

So I was just trying to upload my code to git, I don't know what I did but somehow i'm in a bit of pickle.

Because there are so many conflicts in almost all of my files.

I don't want to resolve each conflict manually by going through each file because there are hundreds of files and there are multiple conflicts in each file.

So how do I tell git to accept all current changes but not the incoming changes or vice versa? Thanks

like image 737
Danz Tim Avatar asked Dec 23 '22 21:12

Danz Tim


2 Answers

git checkout --ours [filename]
git add [filename]

https://dev.to/willamesoares/git-ours-or-theirs-part1-agh

To initiate the merge with this intent, see this post.

like image 63
isherwood Avatar answered Jan 05 '23 16:01

isherwood


git checkout --theirs .
git add .

or

git checkout --ours .
git add .
like image 43
Luca Borrione Avatar answered Jan 05 '23 16:01

Luca Borrione