Local git repo force updated from a remote git repo. (thick-client deployments)

后端 未结 5 675
暖寄归人
暖寄归人 2021-01-15 05:46

Update: I think this is related to an issue with the windows git client msysgit. Sorry to trouble you guys. http://code.google.com/p/msysgit/issues/detail?i

5条回答
  •  無奈伤痛
    2021-01-15 05:55

    I'm assuming you have a good reason for using Git for this, rather than rsync.

    This is how I'd do it (on the Clients):

    git fetch origin
    git reset --hard origin/master
    git clean -dfx
    

    Note that you need to reset to origin/master rather than HEAD because the local HEAD doesn't include the origin's newest commits (yet).

提交回复
热议问题