Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git, must pull, know there will be conflicts, but local version is irrelevant

I know that upon pulling there will be conflicts, but I already know that the repository version is better. How do I resolve all conflicts on the command line with a git command

something like $> git resolve conflict with theirs or something

like image 251
CQM Avatar asked Oct 27 '25 12:10

CQM


1 Answers

If you don't want to keep your changes then pull is the wrong action. If the repository version is unequivocally better you can just fetch and reset.

E.g.

git fetch

# Assuming my branch was based on origin/master,
# throw my changes away.
git reset --hard origin/master

Obviously be careful with this, as you may lose uncommitted changes. You may want to do a plain git reset origin/master and remove your local changes carefully by hand.

like image 124
CB Bailey Avatar answered Oct 30 '25 01:10

CB Bailey