Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git remove files from old commits

git filter-branch --index-filter 
'git rm --cached --ignore-unmatch path/to/mylarge_file' 
--tag-name-filter cat -- --all

filter-branch keeps backups too, so the size of the repo won't decrease immediately unless you expire the reflogs and garbage collect:

rm -Rf .git/refs/original       # careful
git gc --aggressive --prune=now # danger
Comment

git show which commits deleted file

git log --full-history  -- [file path]
Comment

PREVIOUS NEXT
Code Example
Shell :: push an existing repository from the command line 
Shell :: linux no internet connection 
Shell :: replace delimiter for enter command 
Shell :: ubuntu connect openvpn 
Shell :: Count subdirectories within a directory 
Shell :: delete commit 
Shell :: iis restart cfrom command promt windows 
Shell :: refresh desktop entries 
Shell :: reload .bashrc 
Shell :: git get current branch 
Shell :: linux kill aport 
Shell :: install steghide ubuntu 
Shell :: how to check default path of the nginx 
Shell :: install composer on ubuntu 20.04 
Shell :: push existing repo 
Shell :: how to install nginx on docker 
Shell :: git pull override local changes 
Shell :: vim replace multiple lines 
Shell :: sed remove first line 
Shell :: linux while true 
Shell :: firebase install 
Shell :: tv on ubuntu 
Shell :: search package linux 
Shell :: angular cli disable auto reload 
Shell :: Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager. 
Shell :: create git repository pycharm 
Shell :: brew install node sass 
Shell :: gats gatsby-plugin-offline 
Shell :: grep without 
Shell :: push existing repository 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =