git-rewrite-history

git filter-branch remove all submodules from my repo

夙愿已清 提交于 2019-12-07 08:32:31
问题 Hello I have successfully rewrote history and got the 5 folders I wanted to extract using git filter-branch -f --prune-empty --tree-filter 'rm -rf <all unwanted dirs>' and kept all git history. The only remaining issue are submodules, I sill have commits doing Subproject commit <hash> and I want to completely remove ALL of those submodule commits from my git history, how can I accomplish this? 回答1: I have done it with git filter-branch -f --prune-empty --tree-filter ' git submodule deinit -f

Is it possible to rewrite history without leaving trace?

筅森魡賤 提交于 2019-12-07 07:47:50
问题 I have read this question about changing the timestamp of an old commit. What I'd like to know is: this kind of operations is destructive (i.e. don't leave any traces) or is it possible to find out that a certain operation was done on the repository? If is it so, how could I do it? Thanks 回答1: Unless you have acces to the repo where the operation (generally a git filter-branch) has been done, and where you can access the git reflog , you wouldn't be able to audit this kind of change. Meaning

Am I supposed to run BFG on the mirrored repo or the original?

假如想象 提交于 2019-12-07 04:26:26
问题 I want to delete two files from my git repo that aren't there anymore. I put them in, committed, and tried to push but they were too large. So I took them out, and kept working, then committed, tried to push, but it still gave me the same error. I figured they're still in the history somewhere. I think I made the problem worse because I kept working in that branch and made 1 more commit. Then I merged that branch back to the master branch. So I searched for a solution and found bfg. But the

Is there a simple way to remove unwanted file from Github history?

心已入冬 提交于 2019-12-06 15:28:41
问题 I have spend half an hour reading questions and answers and still I didn't find a simple way to do this. So, is there an easy way to remove unwanted file from Github history (just to name the file and delete it)? 回答1: As @VonC says, GitHub doesn't provide the ability to remove files from history through their UI. As an outsider, this would be my view on why that's so: Once the data is up on GitHub, it's already too late in some sense. If the data is private then putting it on GitHub has

How to sync local history after massive git history rewrite?

混江龙づ霸主 提交于 2019-12-06 12:24:26
The question may seem odd, but I have issues syncing git history after rewriting over 100 commits. On the machine I did rewrite from, a simple git fetch synced it all. On another mac machine, git sync did not help, but after a random deleting of local .git/ log and refs files and then issuing git pull , history got refreshed. However, no matter what I do on the Windows machine, I cannot refresh project history. Tried it all: git reset --hard HEAD & git fetch git fetch --all git pull etc Each time on Windows machines, I get duplicated entries (I changed Author fields) of the same commit with a

How to remove all commits of a topic Git branch?

拜拜、爱过 提交于 2019-12-06 04:18:31
Suppose I have the following history: A---B---C----------D------------E master \ /\ / W1--X1--Y1 W2--X2--Y2 topic1 topic2 Is it possible to remove all topic branches and their commits as following A-B-C-D-E master You have a few options for doing this. Solution 1: Squash Merges One solution is to simply use a hard reset with a few squash merges: git checkout master git reset --hard C git merge --squash topic1 git commit -m "Rewrite D" git merge --squash topic2 git commit -m "Rewrite E" # Verify that the new branch is no different from the old one git diff sha_of_old_E The idea here is that a

Git Repository Too Large

旧街凉风 提交于 2019-12-05 18:37:20
问题 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

Inspect git repo after using BFG repo-cleaner

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 18:14:40
Very basic git question: I uploaded some compromising information to Github and am using bfg to clean the repo. I followed the documentation and performed the following actions: $ git clone --mirror git://example.com/some-big-repo.git $ bfg --replace-text passwords.txt my-repo.git I received the following output: Found 233 objects to protect Found 9 commit-pointing refs : HEAD, refs/heads/experimental, refs/heads/master, ... Protected commits ----------------- These are your protected commits, and so their contents will NOT be altered: * commit 497fc1c8 (protected by 'HEAD') Cleaning --------

Is it possible to rewrite history without leaving trace?

给你一囗甜甜゛ 提交于 2019-12-05 17:17:45
I have read this question about changing the timestamp of an old commit. What I'd like to know is: this kind of operations is destructive (i.e. don't leave any traces) or is it possible to find out that a certain operation was done on the repository? If is it so, how could I do it? Thanks VonC Unless you have acces to the repo where the operation (generally a git filter-branch ) has been done, and where you can access the git reflog , you wouldn't be able to audit this kind of change. Meaning that if you clone that repo, the clone has no trace of that "rewrite" operation. And even if you have

git filter-branch remove all submodules from my repo

丶灬走出姿态 提交于 2019-12-05 13:31:13
Hello I have successfully rewrote history and got the 5 folders I wanted to extract using git filter-branch -f --prune-empty --tree-filter 'rm -rf <all unwanted dirs>' and kept all git history. The only remaining issue are submodules, I sill have commits doing Subproject commit <hash> and I want to completely remove ALL of those submodule commits from my git history, how can I accomplish this? I have done it with git filter-branch -f --prune-empty --tree-filter ' git submodule deinit -f . git rm -rf lib && rm -rf lib find . -name .gitmodules -delete' HEAD Assuming that all of my submodules