git - How to reset the origin/master ref locally -


i have following scenario:


  1. i have 3 commits in local repo, this:

    initial -- -- b

    where both master , origin/master point @ b.

  2. after that, fetch origin, , repo looks this:

    initial -- -- b -- c -- d

    where master points @ b , origin/master point @ d.

  3. after that, merge , master points @ d.


i can reset master branch doing git reset --hard b.

what reset origin/master ref commit b. and, not mean want reset remote repository state - want locally only. no pushing. want remote remain unchanged. want change knowledge of local repo regard state of remote repo.

how can that?

i can change files in .git directory, files? or there maybe git command it?

why need that? because want able replay scenario, test git-based project management i'm working on. replay same situation, in order see how behaves if change conditions slightly.

the safest way git update-ref refs/remotes/origin/master <sha>. cause change recorded in reflog, should ever need refer it. though codewizard said, next fetch update ref anyway, there not risk in changing directly either.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -