Skip to main content
Improved formatting
Source Link
Espo
  • 42.1k
  • 21
  • 137
  • 160

You should probably clone your repository first.

Remove your file from all branches history:

You should probably clone your repository first. Remove your file from all branches history: git filter-branch --tree-filter 'rm -f filename.orig' -- --all   Remove your file just from the current branch: 

Remove your file just from the current branch:

git filter-branch --tree-filter 'rm -f filename.orig' -- --HEAD    Lastly you should run to remove empty commits: 

Lastly you should run to remove empty commits:

git filter-branch -f --prune-empty -- --all 
You should probably clone your repository first. Remove your file from all branches history: git filter-branch --tree-filter 'rm -f filename.orig' -- --all   Remove your file just from the current branch: git filter-branch --tree-filter 'rm -f filename.orig' -- --HEAD    Lastly you should run to remove empty commits: git filter-branch -f --prune-empty -- --all 

You should probably clone your repository first.

Remove your file from all branches history:

git filter-branch --tree-filter 'rm -f filename.orig' -- --all 

Remove your file just from the current branch:

git filter-branch --tree-filter 'rm -f filename.orig' -- --HEAD 

Lastly you should run to remove empty commits:

git filter-branch -f --prune-empty -- --all 
added 79 characters in body
Source Link
paulalexandru
  • 9.6k
  • 7
  • 68
  • 100
You should probably clone your repository first. Remove your file from all branches history: git filter-branch --tree-filter 'rm -f filename.orig' -- --all Remove your file just from the current branch: git filter-branch --tree-filter 'rm -f filename.orig' -- --HEAD  YouLastly you should probablyrun cloneto yourremove repositoryempty first.commits: git filter-branch -f --prune-empty -- --all 
Remove your file from all branches history: git filter-branch --tree-filter 'rm -f filename.orig' -- --all Remove your file just from the current branch: git filter-branch --tree-filter 'rm -f filename.orig' -- --HEAD You should probably clone your repository first. 
You should probably clone your repository first. Remove your file from all branches history: git filter-branch --tree-filter 'rm -f filename.orig' -- --all Remove your file just from the current branch: git filter-branch --tree-filter 'rm -f filename.orig' -- --HEAD  Lastly you should run to remove empty commits: git filter-branch -f --prune-empty -- --all 
Source Link
paulalexandru
  • 9.6k
  • 7
  • 68
  • 100

Remove your file from all branches history: git filter-branch --tree-filter 'rm -f filename.orig' -- --all Remove your file just from the current branch: git filter-branch --tree-filter 'rm -f filename.orig' -- --HEAD You should probably clone your repository first.