git-rewrite-history

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

Bitbucket reduce repo size with BFG

时光怂恿深爱的人放手 提交于 2021-01-29 03:34:07
问题 My team's repo on Bitbucket was 1.34GB due to some static assets (videos, images) I've followed instructions from BFG Repo Cleaner and my repo is now 2.37GB which is over our 2GB quota and it is now read only. The commands I've run were pretty much what's on the BFG Homepage, git clone --mirror git://example.com/some-big-repo.git java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 100M some-big-repo.git cd some-big-repo.git git reflog expire --expire=now --all && git gc --prune=now -

How to change the specific string throughout all git message commits?

依然范特西╮ 提交于 2020-12-12 11:31:22
问题 I want to grep and change specific string throughout all messages that are pushed to Github. Is it possible? How? I know how to change last message bye git commit --amend but I want to change all message of all commits. 回答1: Use git-filter-branch with it's --msg-filter option, e.g.: git filter-branch -f --msg-filter 'sed "s/git-svn.*$//g"' -- --all Note that this will change pretty much all your commit ids in your repo, and so everyone who works on your project will thus need to do a fresh

How to restore linear git history after nonlinear merge?

大兔子大兔子 提交于 2020-06-09 17:30:15
问题 Few commits ago I accidentally did a nonlinear merge in my master branch. I have a habit of always trying to keep a linear history, so now I would like to restore the linearity. I have made a dummy repo, which simulates the real situation I'm having for the purposes of making this more simple. Here's a GitHub link to it: https://github.com/ruohola/merge-question Here's the output of git log --oneline --graph --date-order : * 88a4b7e (HEAD -> master, origin/master, origin/HEAD) 11 * 5aae63c 10