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 :: code in terminal 
Shell :: mocha silent 
Shell :: batch file extension 
Shell :: install heroku cli for linux 
Shell :: grub download 
Shell :: how to install jupyterlab 
Shell :: how to update local repo when i make changes to github remote repo 
Shell :: ubuntu iso 
Shell :: Merge Remote Repository With Local Repository in git command 
Shell :: cat ssh rsa 
Shell :: remove all files starting with linux 
Shell :: [from -y ] is not understood in combination with the other options 
Shell :: bash check if string ends with slash 
Shell :: download powershell 7.2.1 
Shell :: Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user 
Shell :: ubuntu mount samba dir 
Shell :: linux stop running script 
Shell :: how to deploy to heroku 
Shell :: chmod execute permissions for everyone 
Shell :: how to install docker linux mint 
Shell :: wget multiple urls from file 
Shell :: sed with variable 
Shell :: how to get out from vim editor 
Shell :: centos 8 force update ip address 
Shell :: powershell add line to beginning of file 
Shell :: convert crt to cer with commnd 
Shell :: ubuntu list files 
Shell :: docker pull command 
Shell :: GIT: change branch 
Shell :: what does git restore do 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =