Remove sensitive files and their commits from Git history

前端 未结 11 2192
借酒劲吻你
借酒劲吻你 2020-11-21 04:36

I would like to put a Git project on GitHub but it contains certain files with sensitive data (usernames and passwords, like /config/deploy.rb for capistrano).

I kno

11条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-21 05:15

    So, It looks something like this:

    git rm --cached /config/deploy.rb
    echo /config/deploy.rb >> .gitignore
    

    Remove cache for tracked file from git and add that file to .gitignore list

提交回复
热议问题