Hiding GitHub token in .gitconfig

后端 未结 4 1448
失恋的感觉
失恋的感觉 2021-02-05 10:27

I would like to store all of my dotfiles on GitHub, including .gitconfig which requires me to hide the GitHub token in the .gitconfig.

To do so I have a \".gitconfig-hid

4条回答
  •  北恋
    北恋 (楼主)
    2021-02-05 11:12

    Add your .gitconfig with git add -N.

    Then git add -p it, edit the hunk, replace the token with anything, and push that. No need for an extra file this way.

    Addendum: on additional modifications of your file, use git add -p again, and edit the hunk so that your initial manipulation not be overwritten.

提交回复
热议问题