Git, Jak zresetować źródło / master do zatwierdzenia?

Zresetowałem mojego lokalnego administratora do zatwierdzenia za pomocą tego polecenia:

git reset --hard e3f1e37

kiedy wchodzę$ git status polecenie, terminal mówi:

# On branch master
# Your branch is behind 'origin/master' by 7 commits, and can be fast-forwarded.

#   (use "git pull" to update your local branch)
#
nothing to commit, working directory clean

Ponieważ chcę zresetować początek / nagłówek, I checkout do pochodzenia / master:

$ git checkout origin/master
Note: checking out 'origin/master'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 2aef1de... master problem fixed for master. its okay now.

i zresetuj nagłówek za pomocą tego polecenia:

$ git reset --hard e3f1e37
HEAD is now at e3f1e37 development version code incremented for new build.

Potem próbowałem dodać zobowiązanie do początku / nagłówka, że ​​nie udało mi się.

$ git commit -m "Reverting to the state of the project at e3f1e37"
# HEAD detached from origin/master
nothing to commit, working directory clean

W końcu sprawdzam u mojego lokalnego mistrza.

$ git checkout master
Switched to branch 'master'
Your branch is behind 'origin/master' by 7 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Ponieważ zresetowałem głowę źródłową / wzorzec, którego się spodziewam lokalnie i początek powinien być w tym samym kierunku, ale jak widać, git mówi, że mój lokalny / główny jest za początkiem / głównym o 7 zatwierdzeń.

Jak mogę rozwiązać ten problem? Rzeczy, których szukam, to Head of local / master i origin / master point do tego samego commit. Poniższy obraz pokazuje, co zrobiłem. Dzięki.

questionAnswers(3)

yourAnswerToTheQuestion