Questions tagged [git-filter-repo]

Below is a quote from git-filter-repo, which is now recommended way when trying to filter a GIT repository using git filter-branch:

git filter-repo is a versatile tool for rewriting history, which includes capabilities I have not found anywhere else. It roughly falls into the same space of tool as git filter-branch but without the capitulation-inducing poor performance, with far more capabilities, and with a design that scales usability-wise beyond trivial rewriting cases. git filter-repo is now recommended by the git project instead of git filter-branch.

While most users will probably just use filter-repo as a simple command line tool (and likely only use a few of its flags), at its core filter-repo contains a library for creating history rewriting tools. As such, users with specialized needs can leverage it to quickly create entirely new history rewriting tools.

33 questions
9
votes
2 answers

How to use git-filter-repo to merge one repo as subdirectory into another

While trying to use git filter-branch to merge repos using this gist. Adding just the relevant snippet in question: git filter-branch -f --prune-empty --tree-filter ' mkdir -p "${REPO_NAME}_tmp" git ls-tree --name-only $GIT_COMMIT |…
Aaghaaz
  • 93
  • 1
  • 4
6
votes
2 answers

git filter-repo: can it be used on a specific branch?

I'm reading about what git filter-repo can do because I want to do a small experiment with it.... I have this repo where I only want to get the history of one directory from, say.... master..... but I don't want to work on master. I would like to…
eftshift0
  • 16,836
  • 2
  • 23
  • 36
5
votes
1 answer

Make git `replace` commits permanent (or such)

I'm busy converting all my existing SVN repositories to Git, and at the same time also take the opportunity to use Git's ability to easily rewrite some history. For this I'm also using git filter-repo, to get rid of unwanted files and do some…
Carl Colijn
  • 1,205
  • 7
  • 21
4
votes
1 answer

Can git filter repo create a monorepo from many repos interweaving commits by date?

Using git-filter-repo is it possible to combine N repositories into a mono-repository re-writing the commits so that the commits are interwoven, or "zippered" up by date? Currently, I'm testing this with only 2 repos with each repo having their own…
brianc
  • 1,345
  • 3
  • 14
  • 28
3
votes
1 answer

git filter-repo: but follow a file if it has moved like git log --follow

In my use case, I have been using git filter-repo to select individual files to move to a new repo preserving history. I have a file that has moved once and am struggling to figure out how to get the history from when it was at a different…
jj2f1
  • 120
  • 6
2
votes
0 answers

question about a git big blob that look like not used

Following the documentation in gitlab doc: reducing_the_repo_size_using_git I'm cleaning a repo from GitLab, so I exported it, got a link by email, downloaded and untared it. aaa_export$ git clone --bare --mirror project.bundle Cloning into bare…
user3313834
  • 5,701
  • 4
  • 40
  • 76
2
votes
1 answer

git filter repo - Python was not found - but it's installed

So I'm trying to use git filter-repo for the first time. I've installed Python 3.9. I try to run: git filter-repo --strip-blobs-bigger-than 100M Each time it fails: Git Bash: git: 'filter-repo' is not a git command. Powershell: Python was not…
spsuk
  • 33
  • 4
1
vote
1 answer

How do I totally remove a specific version of a file from a git repository?

I'm working on a couple of game development projects that involve lots of changes to code and large binary files at the same time. For the sake of simplicity, let's say I have a git repository with 2 files (a text file and a large binary blob) in it…
Donuts
  • 13
  • 2
1
vote
1 answer

Azure Devops: Checkout step slow: to many objects?

First some background info: We are currently in the process of migrating a big git repository from Bitbucket to Azure Devops. There were some challenges because the repository has a history that was full of binary blobs that in hindsight were…
Piet
  • 43
  • 4
1
vote
1 answer

How to run git-filter-repo commands from python script?

Trying to run git-filter-repo command from python. I can't figure out how this should be done. git filter-repo --path README.md --path guides/ --path tools/releases So far I have: filtering_options =…
Mikhail
  • 1,092
  • 1
  • 11
  • 30
1
vote
1 answer

removing files from git history that have changed name or path

I am trying to identify large files in the history of my project that have been deleted. When I do this I can see an ordered list. $ git rev-list --objects --all \ | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)'…
Steve Maring
  • 181
  • 1
  • 2
  • 7
1
vote
1 answer

git filter-repo --refs not bringing tags

I have a couple of large long-lived repos that I'm merging together into one repo, with each current repo as subdirectories of the new repo: oldrepo1 oldrepo2 becomes newrepo/oldrepo1 newrepo/oldrepo2 I'm using git filter-repo to do several…
1
vote
1 answer

How to modify a blob considering both its file path and data with git filter-repo?

For example at How to use git filter-repo as a library with the Python module interface? I managed to modify blobs of older commits for refactoring purposes with something like: def blob_callback(blob, callback_metadata): blob.data =…
1
vote
0 answers

--mirror can't be combined with refspecs when trying to delete files in git history

My gitlab repository is too big so I want to delete every file that is greater than 300KB in the gitlab history. I'm following this tutorial https://docs.gitlab.com/ee/user/project/repository/reducing_the_repo_size_using_git.html The commands I…
relot
  • 531
  • 1
  • 3
  • 11
1
vote
2 answers

How to keep commit hashs not change when use git filter-repo rewrite the history

I have a git repo which has some invalid folder and source committed and deleted. I want to rewrite the history by git filter-repo. Is it possible to keep the commit hash not changing when doing rewrite.
Gavin
  • 25
  • 5
1
2 3