Skip to content

Instantly share code, notes, and snippets.

@pravynandas
Last active November 27, 2023 21:01
Show Gist options
  • Save pravynandas/45c64389c4944215999babe3c30be853 to your computer and use it in GitHub Desktop.
Save pravynandas/45c64389c4944215999babe3c30be853 to your computer and use it in GitHub Desktop.
THE MOST IMPORTANT GIT commands
# To get all users' email addresses
git shortlog -sne > .gituserlist
# To UPDATE all user's email address for a give list
# CORRECT NAME <correct_email> INCORRECT NAME <incorrect_email>
# Install filter-repo from newren/git-filter-repo and move `git-filter-repo` binary to git-core folder (git --exec-path)
git filter-repo --mailmap .gitmailmap --force
# To merge other repository's commit into current repo
# Make sure both repo's don't have merge conflicting files/folders first
git merge -m "Message" otherrepo/branch --allow-unrelated-histories
# To find path from blobid
git rev-list --all --objects | grep blobid
# To delete a file completely from history
git filter-repo --invert-paths --path <PATH>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment