Skip to main content
fixed markup for numbered list
Source Link
Seki
  • 11.5k
  • 7
  • 50
  • 75

For me the following worked:

(1) First fetch all changes:

$ git fetch --all 

(2) Then reset the master:

$ git reset --hard origin/master 

Note - For users of github, "master" was replaced with "main" in October 2020. For projects created since then you may need to use "main" instead, like:

$ git reset --hard origin/main 

(3) Pull/update:

$ git pull 
  1. First fetch all changes:

    $ git fetch --all 
  2. Then reset the master:

    $ git reset --hard origin/master 

    Note - For users of github, "master" was replaced with "main" in October 2020. For projects created since then you may need to use "main" instead, like:

    $ git reset --hard origin/main 
  3. Pull/update:

    $ git pull 

For me the following worked:

(1) First fetch all changes:

$ git fetch --all 

(2) Then reset the master:

$ git reset --hard origin/master 

Note - For users of github, "master" was replaced with "main" in October 2020. For projects created since then you may need to use "main" instead, like:

$ git reset --hard origin/main 

(3) Pull/update:

$ git pull 

For me the following worked:

  1. First fetch all changes:

    $ git fetch --all 
  2. Then reset the master:

    $ git reset --hard origin/master 

    Note - For users of github, "master" was replaced with "main" in October 2020. For projects created since then you may need to use "main" instead, like:

    $ git reset --hard origin/main 
  3. Pull/update:

    $ git pull 
For added clarity- the default "master" has bee updated with "main"
Source Link

For me the following worked:

(1) First fetch all changes:

$ git fetch --all 

(2) Then reset the master:

$ git reset --hard origin/master 

Note - For users of github, "master" was replaced with "main" in October 2020. For projects created since then you may need to use "main" instead, like:

$ git reset --hard origin/main 

(3) Pull/update:

$ git pull 

For me the following worked:

(1) First fetch all changes:

$ git fetch --all 

(2) Then reset the master:

$ git reset --hard origin/master 

(3) Pull/update:

$ git pull 

For me the following worked:

(1) First fetch all changes:

$ git fetch --all 

(2) Then reset the master:

$ git reset --hard origin/master 

Note - For users of github, "master" was replaced with "main" in October 2020. For projects created since then you may need to use "main" instead, like:

$ git reset --hard origin/main 

(3) Pull/update:

$ git pull 
Rollback to Revision 1
Source Link
Artur Barseghyan
  • 14.5k
  • 5
  • 57
  • 47

For me the following worked:

git fetch --all # fetch all changes git reset --hard origin/master # reset the master git pull # pull/update 

(1) First fetch all changes:

$ git fetch --all 

(2) Then reset the master:

$ git reset --hard origin/master 

(3) Pull/update:

$ git pull 

For me the following worked:

git fetch --all # fetch all changes git reset --hard origin/master # reset the master git pull # pull/update 

For me the following worked:

(1) First fetch all changes:

$ git fetch --all 

(2) Then reset the master:

$ git reset --hard origin/master 

(3) Pull/update:

$ git pull 
inline comments for conciseness AND copiability.
Source Link
Hugolpz
  • 18.4k
  • 29
  • 106
  • 193
Loading
Source Link
Artur Barseghyan
  • 14.5k
  • 5
  • 57
  • 47
Loading