Switch Git branch without files checkout

前端 未结 11 1466
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 15:36

Is it possible in Git to switch to another branch without checking out all files?

After switching branch I need to delete all files, regenerate them, commit and swit

11条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-29 16:16

    Or just use a patch file to patch from your otherbranch to your master

    git diff otherbranch master > ~/tmp/otherbranch.diff
    git checkout master
    git apply ~/tmp/otherbranch.diff
    

提交回复
热议问题