Last active
March 26, 2023 13:40
-
-
Save innocarpe/546d34a86821829dd6fa11c8064e9f59 to your computer and use it in GitHub Desktop.
(non-interactive) interactive rebase with autosquash in short command
This file contains hidden or 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
#!/bin/bash | |
# This runs (non-interactive) interactive rebase with autosquash in short command. | |
# 1. Move this file to ~/.gitsh/ | |
# 2. Add directory path($YOUR_HOME_PATH/.gitsh) to environment variable file | |
# (like ~/.bash_profile or ~/.zshrc) | |
# (This would be like 'export PATH=${PATH}:/Users/YOUR_HOME_PATH/.gitsh') | |
# 3. chmod 0755 git-rif | |
# 4. Use the command 'git ri COMMIT_HASH' | |
commit_hash=$1 | |
GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash $commit_hash~1 |
I don't know why this was so hard to find, and I am looking at you google, but thank you for this @innocarpe
Thanks. Hope it will be helpful
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't know why this was so hard to find, and I am looking at you google, but thank you for this @innocarpe