Some time ago I added info(files) that must be private. Removing from the project is not problem, but I also need to remove it from git
history.
I use Gi
.gitignore
file and don't forget to commit the file :-)You can use this site: http://gtiignore.io to generate the .gitignore
for you and add the required path to your binary files/folder(s)
Once you added the file to .gitignore
you can remove the "old" binary file with BFG.
How to remove big files from the repository
You can use git filter-branch
or BFG.
https://rtyley.github.io/bfg-repo-cleaner/
BFG Repo-Cleaner
an alternative to git-filter-branch.
The BFG is a simpler, faster alternative to git-filter-branch for cleansing bad data out of your Git repository history:
* Removing Crazy Big Files*
* Removing Passwords, Credentials & other Private data
In all these examples bfg is an alias for java -jar bfg.jar.
# Delete all files named 'id_rsa' or 'id_dsa' :
bfg --delete-files id_{dsa,rsa} my-repo.git