Remove Files completely from git repository along with its history

前端 未结 3 1308
天命终不由人
天命终不由人 2020-12-12 17:25

I have uploaded a font file that I don\'t have the rights to distribute to git hub several updates ago.

I have a relatively inactive repository and I have the ability

3条回答
  •  旧时难觅i
    2020-12-12 17:51

    I was trying to : Removing sensitive data and history from a repository and ,

    While trying above solution. I found this youtube video, It worked form me : With the reference of the video :

    Command : We need to run this command form git root directory and user relative path of the file in the following command.

    $ git filter-branch --index-filter 'git rm --cache --ignore-unmatch /root-app/props/password.properties' HEAD
    

    Output :

    $ git filter-branch --index-filter 'git rm --cache --ignore-unmatch ./root-app/props/password.properties' HEAD
    Rewrite 7243bb0ad4f3aca3a35e2b5ca86926856e77b666 (14860/14864) (1011 seconds passed, remaining 0 predicted) rm 'root-app/props/password.properties'
    Rewrite 36c00b1203edf35321c0a0204e2fcb6341a5436d (14860/14864) (1011 seconds passed, remaining 0 predicted) rm 'root-app/props/password.properties'
    Rewrite d6bf5d98ec548113f47b9dc7b6dcecf357fdf8db (14860/14864) (1011 seconds passed, remaining 0 predicted) rm 'root-app/props/password.properties'
    

    I hope it will work for others as well.

提交回复
热议问题