git-extras icon indicating copy to clipboard operation
git-extras copied to clipboard

git sync reset --hard?

Open dalehhirt opened this issue 4 years ago • 3 comments

My definition of sync is

  • Pull latest commits
  • Push latest commits

Why does it also do a hard reset?

dalehhirt avatar Mar 08 '21 22:03 dalehhirt

To ensure all the states are synced (not just the commits).

spacewander avatar Mar 09 '21 00:03 spacewander

So that spawns 3 more questions:

  1. Why does the "soft" reset as well? Shouldn't it only do a fetch, and not a reset?
  2. Why do neither do a push? A sync would seem to indicate that we send our commits up as well as pull down?
  3. why not stash any current changes as to avoid a merge conflict?

dalehhirt avatar Mar 11 '21 16:03 dalehhirt

The script is written 5 years ago. I know its purpose, but I can't recall why the author chose A but not B.

spacewander avatar Mar 12 '21 01:03 spacewander