Not Possible to switch branch after --skip-worktree

后端 未结 7 1223
醉酒成梦
醉酒成梦 2020-12-13 03:37

WHAT I WANT TO DO

I have a file which contains sensitive datas so I don\'t want to push content of this file to remote server.

WHAT I DID?

To achiev

7条回答
  •  借酒劲吻你
    2020-12-13 04:31

    You can enable sparse checkout and add the file there together with adding the skip-worktree flag (if you add the sparse checkout alone it probably will be deleted).

    To exclude a file you should put to sparse-checkout file (see git-read-tree manual):

    /*
    !unwanted
    

    Then it will not be touched at update (so you don't get content of the other branch there, instead preserving your edits). It might be not what you want.

提交回复
热议问题