Git interactive rebase between multiple branches

I have a git repository that has a source file containing some confidential content that I want to delete ( I don't want to delete the file, just change its contents ). The end was quite early in the development of the project (when we had only one branch), but now it finds its "I" in n other branches.

Is there any git-fu that I can run to clear it in all branches? Interactive reboot only works one goal at a time.

I found this on github:

git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch DotNet/src/ExternalLibs/GemBox/' \
--prune-empty --tag-name-filter cat -- --all

but it only works for deletion, not corrections .

A-B-C-**STUPID**-D-E-F
                    \
                     \-G-H-I
                          \-J-K
+4
1

, , : , , , rebase, , :

# Checkout a branch "fix" at the commit STUPID
git checkout -b fix STUPID

# Make your file changes...

# Amend STUPID
git add .
git commit --amend -m "REDACTED MWA-HA-HA!"

# Do the BIGGEST rebase that you'll probably ever do in your entire life!
git rebase --preserve-merges --onto fix STUPID master
# or `-p` for short
git rebase -p --onto fix STUPID master

# Verify that the only difference between master and master@{1}
# is the amended content:
git diff master@{1} master

, , master rebase - , , , , git gc:

git reflog expire --expire=now --all
git gc --prune=now

, , :

, rebase , , ... , - .

, , STUPID , , rebase.

1337 git -fu Cupcake: Git 2012 ;)

+2

Source: https://habr.com/ru/post/1535600/


All Articles