Git replace local with remote version

404    Asked by Chandralekhadebbie in SQL Server , Asked on Jul 1, 2021

How can I tell git to ignore my local file and take the one from my remote branch without trying to merge and causing conflicts?

Answered by Camellia Kleiber

To solve git replace local file with remote try:

git stash
git checkout origin/master

If you need to include the remote changes in the master branch you can do:

  git reset --hard origin/master

This will make your branch "master" to point to "origin/master".



Your Answer

Interviews

Parent Categories