Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. # Remove a file from git repository
  2.  
  3. This will rewrite the complete history and remove a file from history. This is useful if you have a repository and added files you want to remove for reasons like accidential credentials or too large files (github now supports up to 100MB).
  4.  
  5. Use following command in your bash
  6.  
  7. git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch path/file' -f
  8.  
  9. # Find a file manually
  10.  
  11. When you search the commit where a file was added or removed you can use git log to search the history.
  12.  
  13. git log --full-history --summary -- path/file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement