Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@akkida746

This comment has been minimized.

Copy link

@akkida746 akkida746 commented Jan 5, 2015

Thanks.

@EMCP

This comment has been minimized.

Copy link

@EMCP EMCP commented Jan 14, 2015

this only affects git-tracked files, correct?

@mentoss

This comment has been minimized.

Copy link

@mentoss mentoss commented May 8, 2015

Спасибо! То что надо.

@SOSTheBlack

This comment has been minimized.

Copy link

@SOSTheBlack SOSTheBlack commented Sep 30, 2015

Thanks.

@Nikeshsuwal

This comment has been minimized.

Copy link

@Nikeshsuwal Nikeshsuwal commented Feb 23, 2016

Thanks.

@ArtemAK

This comment has been minimized.

Copy link

@ArtemAK ArtemAK commented Jun 15, 2016

Thanks!

@kalljoshua

This comment has been minimized.

Copy link

@kalljoshua kalljoshua commented Jul 15, 2016

A lot helpful, thank you.

@nelsonauner

This comment has been minimized.

Copy link

@nelsonauner nelsonauner commented Jul 19, 2016

👍

@BumbuKhan

This comment has been minimized.

Copy link

@BumbuKhan BumbuKhan commented Aug 5, 2016

Thanks!

@narthur

This comment has been minimized.

Copy link

@narthur narthur commented Aug 15, 2016

You saved me!

@davidjsalazarmoreno

This comment has been minimized.

Copy link

@davidjsalazarmoreno davidjsalazarmoreno commented Aug 24, 2016

Thanks

@maximzasorin

This comment has been minimized.

Copy link

@maximzasorin maximzasorin commented Aug 30, 2016

Thanx.

@cesapunar

This comment has been minimized.

Copy link

@cesapunar cesapunar commented Oct 6, 2016

thanks

@igavdan

This comment has been minimized.

Copy link

@igavdan igavdan commented Oct 6, 2016

Cool!

@sid-sahani

This comment has been minimized.

Copy link

@sid-sahani sid-sahani commented Oct 18, 2016

Best solution... After an hour of fiddling, I reached here. Really a savior !!

@RaphaelBlehoue

This comment has been minimized.

Copy link

@RaphaelBlehoue RaphaelBlehoue commented Nov 29, 2016

Thanks

@Seraph2000

This comment has been minimized.

Copy link

@Seraph2000 Seraph2000 commented Dec 7, 2016

And it works! Thanks so much for sharing!

@DKepov

This comment has been minimized.

Copy link

@DKepov DKepov commented Jan 18, 2017

Thanks!

@jebog

This comment has been minimized.

Copy link

@jebog jebog commented Jan 25, 2017

Thanks

@Dr-Turner

This comment has been minimized.

Copy link

@Dr-Turner Dr-Turner commented Jan 27, 2017

Lifesaver. Thanks!

@kkuivenhoven

This comment has been minimized.

Copy link

@kkuivenhoven kkuivenhoven commented Feb 6, 2017

Works great. Thanks 😄

@albertjimenez

This comment has been minimized.

Copy link

@albertjimenez albertjimenez commented Jun 4, 2017

Awesome! Saved my life

@linhtc

This comment has been minimized.

Copy link

@linhtc linhtc commented Jul 3, 2017

Many thanks

@anandhans8

This comment has been minimized.

Copy link

@anandhans8 anandhans8 commented Jul 12, 2017

Awesome! Saved my time.

@tihomirjauk

This comment has been minimized.

Copy link

@tihomirjauk tihomirjauk commented Oct 25, 2017

Tnx 👍

@DevJY

This comment has been minimized.

Copy link

@DevJY DevJY commented Dec 8, 2017

Thanks! :)

@tankywoo

This comment has been minimized.

Copy link

@tankywoo tankywoo commented Dec 20, 2017

Thanks.

And the last step git pull origin master is needless. git fetch will sync the objects to local.

@isaacOstler

This comment has been minimized.

Copy link

@isaacOstler isaacOstler commented Jan 16, 2018

To you, I wish the most earnest of feelings. Many thanks chaps

@sundowndev

This comment has been minimized.

Copy link

@sundowndev sundowndev commented Jan 22, 2018

t h a n k s m y d u d e

@tobikummer

This comment has been minimized.

Copy link

@tobikummer tobikummer commented Jan 26, 2018

great 👌

@jeakwon

This comment has been minimized.

Copy link

@jeakwon jeakwon commented Jan 26, 2018

thanks

@saugatsthapit

This comment has been minimized.

Copy link

@saugatsthapit saugatsthapit commented Mar 2, 2018

thanks

@davama

This comment has been minimized.

Copy link

@davama davama commented Mar 29, 2018

danke 👍

@jisooyu

This comment has been minimized.

Copy link

@jisooyu jisooyu commented Apr 21, 2018

Great! Many thanks.

@camilamiraglia

This comment has been minimized.

Copy link

@camilamiraglia camilamiraglia commented May 28, 2018

Thank you so much!!

@joaquinwojcik

This comment has been minimized.

Copy link

@joaquinwojcik joaquinwojcik commented Jul 3, 2018

Awesome! Thank you.

@HoussamYactine

This comment has been minimized.

Copy link

@HoussamYactine HoussamYactine commented Jul 10, 2018

Thank you so much

@Ericwonne

This comment has been minimized.

Copy link

@Ericwonne Ericwonne commented Jul 11, 2018

Thanks a lot. I bet this helped a lot of people.

@Alexiades

This comment has been minimized.

Copy link

@Alexiades Alexiades commented Jul 26, 2018

Thanks!!

@gistrec

This comment has been minimized.

Copy link

@gistrec gistrec commented Jul 27, 2018

😈 😈 😈

@bheku

This comment has been minimized.

Copy link

@bheku bheku commented Aug 1, 2018

3 years on, still helpful.

Thank you.

@icosahedron

This comment has been minimized.

Copy link

@icosahedron icosahedron commented Aug 6, 2018

3 years and 5 days on, and it's still useful. Gracias.

@bulunduc

This comment has been minimized.

Copy link

@bulunduc bulunduc commented Aug 30, 2018

yeah! thanks! you saved me=)

@JobvG

This comment has been minimized.

Copy link

@JobvG JobvG commented Oct 1, 2018

Thanks

@dyp2000

This comment has been minimized.

Copy link

@dyp2000 dyp2000 commented Oct 16, 2018

👍

@jadia

This comment has been minimized.

Copy link

@jadia jadia commented Nov 1, 2018

Thank you!

@everhdezz

This comment has been minimized.

Copy link

@everhdezz everhdezz commented Nov 14, 2018

Thank you!

@rtwalz

This comment has been minimized.

Copy link

@rtwalz rtwalz commented Nov 14, 2018

great

@hyperking

This comment has been minimized.

Copy link

@hyperking hyperking commented Nov 15, 2018

I would like to add this line just in case you need to revert.
This assumes you are always using the master branch.

git checkout -b backup_branch_name
git checkout master
git fetch --all
git reset --hard origin/master
git pull origin master
@brickzva

This comment has been minimized.

Copy link

@brickzva brickzva commented Dec 12, 2018

it's still good from 5 years ago... thanks!

@JAGFx

This comment has been minimized.

Copy link

@JAGFx JAGFx commented Dec 13, 2018

Many thanks !

@riverdigger

This comment has been minimized.

Copy link

@riverdigger riverdigger commented Dec 13, 2018

gracias my duderino

@Kev8144

This comment has been minimized.

Copy link

@Kev8144 Kev8144 commented Jan 29, 2019

Still helpful in 2019, thanks!

@panique

This comment has been minimized.

Copy link

@panique panique commented Apr 5, 2019

<3

@Phetparisouk

This comment has been minimized.

Copy link

@Phetparisouk Phetparisouk commented Apr 18, 2019

nice thanks !

@cybersaiyan30

This comment has been minimized.

Copy link

@cybersaiyan30 cybersaiyan30 commented Apr 23, 2019

Thanx

@lucnicolas

This comment has been minimized.

Copy link

@lucnicolas lucnicolas commented May 10, 2019

Thanks again 👍

@valmirphp

This comment has been minimized.

Copy link

@valmirphp valmirphp commented May 24, 2019

Thanks

@onyegood

This comment has been minimized.

Copy link

@onyegood onyegood commented Jun 1, 2019

Thanks

@monilert

This comment has been minimized.

Copy link

@monilert monilert commented Jun 27, 2019

thank you

@lucasamparo

This comment has been minimized.

Copy link

@lucasamparo lucasamparo commented Jun 28, 2019

Thanks again

@nurSaadat

This comment has been minimized.

Copy link

@nurSaadat nurSaadat commented Jul 29, 2019

Thank you!

@yc-codes

This comment has been minimized.

Copy link

@yc-codes yc-codes commented Jul 31, 2019

Thanks Bro!
:)

@Ned452

This comment has been minimized.

Copy link

@Ned452 Ned452 commented Aug 6, 2019

Спасибо!

@calvincramer

This comment has been minimized.

Copy link

@calvincramer calvincramer commented Aug 13, 2019

谢谢!

@rustyhaidu

This comment has been minimized.

Copy link

@rustyhaidu rustyhaidu commented Aug 23, 2019

many thanks!

@macknilan

This comment has been minimized.

Copy link

@macknilan macknilan commented Dec 11, 2019

Gracias! - Thanks! - muito obrigado

@XixoWreden

This comment has been minimized.

Copy link

@XixoWreden XixoWreden commented Jan 13, 2020

Muy útil! Gracias

@cossio

This comment has been minimized.

Copy link

@cossio cossio commented Jan 24, 2020

Thanks! Is there a way to compress all this to a single command?

@calvincramer

This comment has been minimized.

Copy link

@calvincramer calvincramer commented Jan 24, 2020

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

@stevebaros

This comment has been minimized.

Copy link

@stevebaros stevebaros commented Jan 31, 2020

Thanks still works in 2020

@Joaquin121416

This comment has been minimized.

Copy link

@Joaquin121416 Joaquin121416 commented Feb 14, 2020

Gracias

@MFraGaM

This comment has been minimized.

Copy link

@MFraGaM MFraGaM commented Feb 27, 2020

Thanks

@arthurduarte1

This comment has been minimized.

Copy link

@arthurduarte1 arthurduarte1 commented Mar 9, 2020

Thank you!

@ljmoleiro

This comment has been minimized.

Copy link

@ljmoleiro ljmoleiro commented Mar 21, 2020

You are getting so much thanks haha. One more thank you

@tylermneher

This comment has been minimized.

Copy link

@tylermneher tylermneher commented Mar 31, 2020

Accomplished exactly what I needed, thank you very much!

@mnamba

This comment has been minimized.

Copy link

@mnamba mnamba commented Apr 4, 2020

Worked fine for me

@1cookspe

This comment has been minimized.

Copy link

@1cookspe 1cookspe commented Apr 27, 2020

Awesome 👍

@depaz9702

This comment has been minimized.

Copy link

@depaz9702 depaz9702 commented Jul 27, 2020

thanks

@mottorres

This comment has been minimized.

Copy link

@mottorres mottorres commented Aug 3, 2020

Thank you 👍

@vikrant-d1

This comment has been minimized.

Copy link

@vikrant-d1 vikrant-d1 commented Aug 22, 2020

Thanks

@Bruno-Garcia-1

This comment has been minimized.

Copy link

@Bruno-Garcia-1 Bruno-Garcia-1 commented Aug 23, 2020

Very good, thanks!

@rashid327

This comment has been minimized.

Copy link

@rashid327 rashid327 commented Aug 28, 2020

Thank You!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.