git-rewrite-history

Git Repository Too Large

♀尐吖头ヾ 提交于 2019-12-04 02:55:25
I have a project with ~12MB worth of code and assets in it. I've been tracking it using Git, and just noticed that my .git folder is now just over 1.83GB. It consists of a few small files, and then just one pack file that makes up about 1.82GB of the folder. I've run git gc --aggressive and git gc --prune . It's the same size. I've tried: git reflog expire --expire=now --all git repack -ad # Remove dangling objects from packfiles git prune # Remove dangling loose objects But it's still the same size. I've even cloned it (once locally with a forced repack, and once again from Git), but it's

git-filter-branch to remove strings, but where strings contain $ ' \ and other characters

时光总嘲笑我的痴心妄想 提交于 2019-12-03 22:38:48
问题 I'm trying to rewrite history, using: git filter-branch --tree-filter 'git ls-files -z "*.php" |xargs -0 perl -p -i -e "s#(PASSWORD1|PASSWORD2|PASSWORD3)#xXxXxXxXxXx#g"' -- --all as described in this tutorial. However, the password strings I have contain all kinds of non- A-Z characters, e.g. $ ' and \, rather than being nice simple 'PASSWORD1' type strings in the example above. Can someone explain what escaping I need? I've not been able to find this anywhere, and I've been battling with

Removing unwanted files from history including all refs with filter-branch

南笙酒味 提交于 2019-12-03 19:39:16
I recently have cloned an SVN repository which used to have a few binaries in it, which are not needed any longer. Unfortunately, I have already pushed it to Github with the binaries inlcuded. I now want to remove these using 'git filter-branch' but I am facing some problems when it comes to tags and branches. Basically, I have created a simple shell script to remove a list of files which have been determined by the following command: git rev-list --objects --all | grep .jar > files.txt The script for removal looks like the following: #!/bin/sh while read file_hash file_to_remove do echo

Why is my .git file huge?

我怕爱的太早我们不能终老 提交于 2019-12-03 15:42:05
I accidentally added and committed some very large (100MB+) PSD files in a git directory. I made a bunch of edits to those files while they were in the directory, but then realized they shouldn't be there and removed them from the directory. I then ran: git add --all && git commit -m "Removed large psds" The files in my directory now add up to less than a dozen MB, except for the .git file itself however, which is 700MB+. What is going on here? Is it retaining old versions of the removed .PSD files? Does that mean git doesn't ever clear out the space gained from deleting files? How do I have

Can I rewrite an entire git repository's history to include something we forgot?

ぃ、小莉子 提交于 2019-12-03 14:20:34
We recently completed a conversion from Mercurial to Git, everything went smoothly, we were even able to get the transforms needed to make everything look / work relatively correctly in the repository. We added a .gitignore and got underway. However we're experiencing some extreme slowdowns as soon as we encorporate/work with any of our old feature branches. A little exploring and we found that since the .gitignore was only added to the develop branch when we look at other commits without merging develop up into them git chuggs because it's choking trying to analyze all our build artifacts

Rebase entire development branch onto new master branch

喜你入骨 提交于 2019-12-03 14:15:22
I'm working with a repository that in theory should be following the Gitflow Workflow (see A successful git branching model by Vincent Driessen). However, the initial commit on the repository was made on the develop branch and there is no master branch to be seen. It's nearing release time and I need to create a master branch that reflects the production-ready state of the project which should've been there from the start. Keep in mind that the develop branch has multiple feature branches coming off of it. The repository is entirely local and hasn't been pushed. My idea was to create an orphan

How to delete one folder / directory using BFG repo cleaner?

一世执手 提交于 2019-12-03 11:29:10
How do I delete only one directory using BFG? The help says: delete folders with the specified names (eg '.svn', '*-tmp' - matches on folder name, not path within repo) Which seems to mean that --delete-folders "config" will match all folders named config, anywhere in the repository. rm.rf.etc I found the answer here: remove files from specific path The author of BFG says it can't be done, unless you use a special command to dump all blobs for a given directory to a text file, and then use --strip-blobs-with-ids and provide that text file. [UPDATE] This doesn't work for me. I run the command:

How to permanently delete a commit from Git's history?

荒凉一梦 提交于 2019-12-03 03:37:08
How can I permanently delete a commit from Git's history? One of the developers on the team has accidentally committed a 200 MB file and pushed it to our Git server. It was deleted a few days later but the history is there. Our code files are only about 75 MB, and we have 4 branches. Due to the 200 MB file commit, the history is preserved and the size of our project folder (specifically the hidden .git folder) has ballooned to close to 700 MB. How do I permanently delete the two check-ins (commit of the huge file, delete of the huge file) from git as if it never happened? I'm using

How do I remove a big file wrongly committed in git [duplicate]

我与影子孤独终老i 提交于 2019-12-03 00:16:13
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How to purge a huge file from commits history in Git? I did a stupid thing. Imagine that I committed a 100MB file. Then I see this and delete this file and commit again. This is a normal procedure to delete a file. But now the side effect is that my history is heavy because it's saved this large file (I believe this is why it is heavy). I am only using local git, so I do not synchronize in any server. How can I

How do I remove a big file wrongly committed in git [duplicate]

萝らか妹 提交于 2019-12-02 14:00:28
Possible Duplicate: How to purge a huge file from commits history in Git? I did a stupid thing. Imagine that I committed a 100MB file. Then I see this and delete this file and commit again. This is a normal procedure to delete a file. But now the side effect is that my history is heavy because it's saved this large file (I believe this is why it is heavy). I am only using local git, so I do not synchronize in any server. How can I definitively remove this file and save disk space? You can do it using the git filter-branch command, like this : git filter-branch --tree-filter 'rm -rf path/to