git-filter-branch

Removing big files from Git history

☆樱花仙子☆ 提交于 2021-02-13 17:26:13
问题 I've read multiple answers advising on using either filter-branch or BFG to accomplish this task, but I feel I need further advice because my situation is a bit peculiar. I have to manage two repositories, one is basically a clone of the other, and ideally, I'd want to pull the changes from the origin into the clone on a daily basis. However, the origin repo contains very big files in its history, which are above Github's size limits. So I have to remove these files, but at the same time, I

How to move a subdirectory from a branch in one git repository to a branch in a different repository, preserving history?

*爱你&永不变心* 提交于 2021-02-08 03:39:27
问题 I've got a directory containing utility libraries that were developed in a branch in one git repository, but it turns out they really belong in a different directory in a different project. I've read through and attempted Greg Bayer's Moving Files from one Git Repository to Another, Preserving History multiple times, but I'm unable to preserve history. I'm attempting to do this all under non-master branches to be more safe as the project is not ready to merge back to master yet anyway. Here's

How to substitute words in Git history & properly debug related problems?

£可爱£侵袭症+ 提交于 2021-02-04 19:24:05
问题 I'm trying to remove sensitive data like passwords from my Git history. Instead of deleting whole files I just want to substitute the passwords with removedSensitiveInfo . This is what I came up with after browsing through numerous StackOverflow topics and other sites. git filter-branch --tree-filter "find . -type f -exec sed -Ei '' -e 's/(aSecretPassword1|aSecretPassword2|aSecretPassword3)/removedSensitiveInfo/g' {} \;" When I run this command it seems to be rewriting the history (it shows

Is it possible to use git filter-branch with dirty working directory?

不问归期 提交于 2021-01-29 17:30:39
问题 For reasons outside of my control, I am working with a repository that has many copies of similar content (a small OS). This means that while the repo size is fairly small, the working directory takes multiple hours to checkout on my system. The specific tasks being performed is doing a git replace --graft to concatenate linear histories, then doing git filter-branch --tag-filter cat -- master to make the change permanent. My issue is that filter-branch requires a clean working copy (such as

Git filter-repo - failed on add files to root commit

走远了吗. 提交于 2020-12-13 03:10:40
问题 Trying to add file to the root of the branch fails with following error: git filter-repo --force --commit-callback "if not commit.parents: commit.file_changes.append(FileChange(b'M', 'C:\MDC\MDC.7z', $(git hash-object -w 'C:\MDC\MDC.7z'), 100644))" Traceback (most recent call last): File "C:/Program Files/Git/mingw64/libexec/git-core\git-filter-repo", line 3839, in <module> filter = RepoFilter(args) File "C:/Program Files/Git/mingw64/libexec/git-core\git-filter-repo", line 2661, in __init__

unknown object type 0 at offset - all repo mirrors corrupted preventing filter-branch subdirectory-filter

こ雲淡風輕ζ 提交于 2020-07-07 11:30:59
问题 1) Problem Description I have several pack files saying unknown object type 0 at offset , and unlike 99% of posts on the web this isn't a local problem but appears in both remote and cloned repos. 2) What I want to do How do I simply remove those invalid references so that I'm not blocked from doing other operations on the repo? Ultimately, I want to run a git filter-branch --subdirectory command to split my 9.2G repo into submodules, but it chokes on these invalid pack files (note: index

unknown object type 0 at offset - all repo mirrors corrupted preventing filter-branch subdirectory-filter

≡放荡痞女 提交于 2020-07-07 11:29:06
问题 1) Problem Description I have several pack files saying unknown object type 0 at offset , and unlike 99% of posts on the web this isn't a local problem but appears in both remote and cloned repos. 2) What I want to do How do I simply remove those invalid references so that I'm not blocked from doing other operations on the repo? Ultimately, I want to run a git filter-branch --subdirectory command to split my 9.2G repo into submodules, but it chokes on these invalid pack files (note: index

git filter branch to git filter repo conversion

◇◆丶佛笑我妖孽 提交于 2020-07-07 05:04:21
问题 I am following this command to perform prettier over all commits in my git repository: git filter-branch --tree-filter 'prettier --write "**/**.js" || echo “Error formatting, possibly invalid JS“' -- --all I want to perform the same in git filter repo but I am not even sure whether that is achievable. Can anyone help on how to approach this with git filter repo? 回答1: I want to perform the same in git filter repo but I am not even sure whether that is achievable Yes, it is a blob callback and

git filter branch to git filter repo conversion

此生再无相见时 提交于 2020-07-07 05:02:20
问题 I am following this command to perform prettier over all commits in my git repository: git filter-branch --tree-filter 'prettier --write "**/**.js" || echo “Error formatting, possibly invalid JS“' -- --all I want to perform the same in git filter repo but I am not even sure whether that is achievable. Can anyone help on how to approach this with git filter repo? 回答1: I want to perform the same in git filter repo but I am not even sure whether that is achievable Yes, it is a blob callback and

Change the root commit parent to point to another commit (connecting two independent git repositories)

跟風遠走 提交于 2020-07-05 11:24:50
问题 I have a project that has more than 3 years of history in the svn repository. It was migrated to git, but the guy who did this, just take the last version and throw out all these 3 years of history. Now the project has the last 3-4 months of history in one repository, and I've imported the other 3 years of svn history into a new git repository. Is there some way to connect the root commit of the second repository into the last commit of the first one? It is something like this: * 2017-04-21 -