Remove sensitive files and their commits from Git history

前端 未结 11 2235
借酒劲吻你
借酒劲吻你 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:30

    Here is my solution in windows

    git filter-branch --tree-filter "rm -f 'filedir/filename'" HEAD

    git push --force

    make sure that the path is correct otherwise it won't work

    I hope it helps

提交回复
热议问题