Created
July 30, 2025 17:31
-
-
Save Aviksaikat/47d8b74d37c7010476382173def28246 to your computer and use it in GitHub Desktop.
fetch & force rabase git branches
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 | |
| # $1 = path, $2 = branch | |
| if [ "$#" -ne 2 ]; then | |
| echo "[!] Usage: ${0} <path> <branch_name>" | |
| exit | |
| fi | |
| cd $1 | |
| git fetch origin | |
| git rebase origin/master | |
| git push --force-with-lease origin $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment