How to get a fresh copy of a branch from the remote repository?

后端 未结 2 659
鱼传尺愫
鱼传尺愫 2021-01-30 12:10

My friend\'s local master branch is apparently a disaster (through accidental merges and commits, I guess). However, his dev branches are

2条回答
  •  旧时难觅i
    2021-01-30 12:44

    Paŭlo Ebermann's answer is correct:

    git checkout master
    git reset --hard origin/master
    

    And add that if you also wish to remove untracked files and ignored files:

    git clean -xfn # dry run with -n
    

    Source with further details: How to remove local (untracked) files from the current Git working tree?

提交回复
热议问题