git-rewrite-history

Re-wrote git history with bfg but not reflected in earlier commits

孤人 提交于 2019-12-24 21:19:23
问题 A huge folder in my repository has filled up my LFS. As instructed here, I wish to remove the folder from the remote repository and then re-write history to drop it from all previous commits. That should free up lots of space in my LFS, but is not. What am I missing? Say the repository is repo and the folder in question is repo/unwantedFolder . I did the following steps: Removed the unwantedFolder and re-committed: $ git rm -r --cached unwantedFolder/ $ git commit -a -m 'Drops folder' $ git

Git: How to rewrite a remote history?

夙愿已清 提交于 2019-12-23 19:07:07
问题 A coworker accidentally committed a large binary file which has no business being in source control thus causing the repository to be unusually large. He then pushed this commit to the common server and since then there were a bunch of other commits and pushes. I'm looking for a way to undo that commit or just remove the binary file from it on the remote so that the repository would regain its usual size. Our common remote is at assembla.com so I don't have direct shell access to it, just git

Git: How to delete committed file permanently?

痞子三分冷 提交于 2019-12-23 05:29:27
问题 I have committed a file that shouldn't be in a git repository. I have deleted it and committed the deletion, but I can still access the file via the git history. How do I delete a committed file permanently, so that there is no trace of it? 回答1: You can remove permanently a file using filter-branch . It will apply the command in argument in every revision of your repository. git filter-branch --tree-filter 'rm -rf your_file' HEAD This detailed post might help you. The git doc is pretty

Connect git historys after cut

别说谁变了你拦得住时间么 提交于 2019-12-23 02:57:23
问题 My two repos are from the same project. I make a history cut after commit 3 and work now only with Repo ProjectnameWorking . git log Repo "ProjectnameArchiv": 30114b2afac5d1c5a968441151ee8f91fc015ff3 4 9aa472d04501a14b5b704fde32445461f99f539a 3 1d0e5abe5daf60c0d86819938ba1aefd44b87ff5 2 766f4880e8ccf61bdc718dfae62466f800ae8119 1 git log Repo "ProjectnameWorking": 2932c4b8ea681f0a97bf151ccc46d2044e8e5a50 5 27ec1a4618f1bf0025b8ba83fd69c2607cdf78d4 4 Is there a way to connect later both historys

How to sync local history after massive git history rewrite?

最后都变了- 提交于 2019-12-22 15:01:53
问题 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

Remove a lot of files in git filter-branch

女生的网名这么多〃 提交于 2019-12-21 09:14:16
问题 I'm migrating a repository from svn to git. In this last step, I want to remove tons of files that aren't needed from the history. I'm trying the following command: git filter-branch --prune-empty --index-filter \ "for file in $(cat files); do git rm -rf --cached --ignore-unmatch ${file}; done" -f But it says that the argument list is too long. I could rewrite this like: for file in $(cat files); do git filter-branch --prune-empty --index-filter \ "git rm -rf --cached --ignore-unmatch ${file}

Why is my .git file huge?

只愿长相守 提交于 2019-12-21 04:59: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

Rebase entire development branch onto new master branch

夙愿已清 提交于 2019-12-20 23:27:04
问题 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

Git Merge Duplication after Ineffective BFG Use

北战南征 提交于 2019-12-18 12:33:19
问题 I have somehow deeply borked by entire repository (used only by me) and could use some assistance in sorting it out. Here is what I did. I realized that in my commit history, there were some files containing credentials that I did not want just laying around. So, I decided to be legit and try to use the BFG Repo-Cleaner to fix these issues. I threw all the credentials in .gitignores, and moved on to trying to scrub them out of the history. As per the documentation instructions, I executed

How can I combine Git repositories into a linear history?

£可爱£侵袭症+ 提交于 2019-12-17 23:34:21
问题 I have two git repositories R1 and R2 , which contain commits from two periods of a product's development: 1995-1997 and 1999-2013. (I created them by converting existing RCS and CVS repositories into Git.) R1: A---B---C---D R2: K---L---M---N How can I combine the two repositories into a single one that contains an accurate view of the project's linear history? A---B---C---D---K---L---M---N Note that between R1 and R2 files have been added, deleted, and renamed. I tried creating an empty