Last active
November 27, 2023 21:01
-
-
Save pravynandas/45c64389c4944215999babe3c30be853 to your computer and use it in GitHub Desktop.
THE MOST IMPORTANT GIT commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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