Shell/Bash: git overwrite local changes Example


Shell/Bash Example: This is the "git overwrite local changes" Example. compiled from many sources on the internet by

git overwrite local changes

git fetch --all
git reset --hard origin/master

git pull hard

git reset --hard origin/master

force git pull overwrite

# if working with newer repos where 'master' is now 'main'
git fetch --all
git reset --hard origin/main 

* Summary: This "git overwrite local changes" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!