Last active
September 6, 2019 09:27
-
-
Save innocarpe/de22cc1153dfdf67fd14fa20efb4f827 to your computer and use it in GitHub Desktop.
Short git command for git interactive rebase (w/ last N commits)
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
#!/bin/bash | |
# This runs interactive rebase with short command. | |
# It is equal to `git rebase -i HEAD~$OFFSET | |
# 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-ri | |
# 4. Use the command 'git rih 4' | |
offset=$1 | |
git rebase -i --autosquash HEAD~$offset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment