Last active
April 9, 2024 16:12
-
-
Save Fallenstedt/14b8b4db7642b301e5281f37ab469234 to your computer and use it in GitHub Desktop.
Syncs upstream branch with local branch
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 | |
if [ -d ".git" ]; then | |
echo "git repo detected" | |
echo "checking out $1..." | |
git checkout $1 | |
echo "fetching origin $1..." | |
git fetch origin $1 | |
echo "merging origin $1 to local $1..." | |
git merge origin/$1 | |
echo "done" | |
else | |
echo "no git repo detected" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment