Created
December 22, 2023 07:04
-
-
Save goromlagche/8edfaf51aa20993b0bcb0fc032451a1d to your computer and use it in GitHub Desktop.
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 | |
current_branch=$(git rev-parse --abbrev-ref HEAD) | |
remote="$1" | |
if [ "$current_branch" == "main" ] && [ "$remote" == "origin" ]; then | |
echo "You can not push to $remote from $current_branch" | |
exit 1 | |
fi | |
echo "Pushing to $remote from $current_branch" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment