GIT-STRIP-MERGE(1)
π GIT-STRIP-MERGE(1) β the general commands manual, but make it a group chat β¨
okay bestie, so this is git-strip-merge, and it's a git-merge wrapper that deletes files on a "foreign" branch before it merges. yeah. it's giving surgical. π¦
πΈ NAME πΈ
git-strip-merge β a git-merge wrapper that deletes files on a "foreign" branch before merging π
β¨ SYNOPSIS β¨
git-strip-merge [git-merge options] [-M <commitmsg>] <branch> FILE...
like, that's the whole vibe. <branch>, then your FILE(s), and all the options gotta come before. π
π«Ά DESCRIPTION π«Ά
It's a git-merge that deletes files on the "foreign" <branch> before merging. no cap. π₯
Super useful when you wanna ignore a folder in <branch> before merging it with your current branch. the way it works: it deletes FILE(S) in a detached commit based on <branch>, and then performs the merge of this new commit into the current branch. so clean. β¨
lowkey important: <branch> is not changed by this procedure. your branch is safe, she's untouched, main character energy only π
Also note (iykyk) that <branch> may actually be any reference, like a tag, or a remote branch, or even a commit SHA. literally anything git can point at. π
For more information, see <http://stackoverflow.com/questions/3111515> π
π OPTIONS π
-h,--helpβ show help message and exit. simple. iconic. π-v,--verboseβ do not use-qto suppress the normal output of internal steps fromgit checkout,rm,commit. By default, onlygit mergeoutput is shown. Errors, however, are never suppressed. so like, if something breaks, you will hear about it π-M <message>,--msgcommit=<message>β message for the removal commit in<branch>. Not to be confused with the message of the merge commit, which is set by-m. Default message is:"remove files from '<branch>' before merge". π-m <message>,--message=<message>β message for the merge commit. Since we are not merging<branch>directly, but rather a detached commit based on it, we forge a message similar to git's default for a branch merge. Otherwise git would use in message the full and ugly SHA1 of our commit. and honestly? nobody wants that SHA1 in their log, it's giving unreadable π
For both commit messages, the token <branch> is replaced for the actual <branch> name. so cute, it personalises itself π
Additional options are passed unchecked to git merge. no vibes checked, just sent straight through π«
β οΈ All options must precede<branch>and FILE(s), except-hand--helpthat may appear anywhere on the command line. the two little freelancers. periodt.
π EXAMPLE π
git-strip-merge design "photoshop/*"
ate. no crumbs. π
π§ SEE ALSO π§
<https://github.com/MestreLion/git-tools> β
π AUTHOR π
Rodrigo Silva (MestreLion) linux@rodrigosilva.com π
okay that's the whole page bestie, you're so ready. this was GIT-STRIP-MERGE(1) from the General Commands Manual, dated 2016-01-31 β yeah she's a 2016 girlie but she still slays πΈ go forth and strip those merges, mwah π
π¦ where this page comes from
- debian bookworm: git-restore-mtime 2022.12-1 Β· GPL-3.0-or-later
- debian trixie: git-restore-mtime 2022.12-1 Β· GPL-3.0-or-later
- epel 10: git-tools 2025.08-1.el10_2 Β· GPL-3.0-or-later
- epel 9: git-tools 2025.08-1.el9 Β· GPL-3.0-or-later
- fedora 43: git-tools 2025.08-1.fc43 Β· GPL-3.0-or-later
- fedora 44: git-tools 2025.08-2.fc44 Β· GPL-3.0-or-later
- nixos 26.05: git-tools 2025.08
- nixpkgs unstable: git-tools 2025.08
- ubuntu jammy: git-restore-mtime 2020.09-1 Β· GPL-3.0-or-later
- ubuntu noble: git-restore-mtime 2022.12-1 Β· GPL-3.0-or-later
- ubuntu questing: git-restore-mtime 2022.12-1
- ubuntu resolute: git-restore-mtime 2022.12-1build1 Β· GPL-3.0-or-later
- ubuntu stonking: git-restore-mtime 2022.12-1build1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms