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 -q to suppress the normal output of internal steps from git checkout, rm, commit. By default, only git merge output 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 -h and --help that 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 πŸ’