Switch Git branch without files checkout

前端 未结 11 1459
佛祖请我去吃肉
佛祖请我去吃肉 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:21

    you can make use of

          1. git checkout -f 
          2. git cherry-pick -x 
    

    previous-branch-commit-id is the commit from where you want to copy old the data.

提交回复
热议问题