Last active
October 8, 2015 18:58
-
-
Save marcuswestin/3375528 to your computer and use it in GitHub Desktop.
These scripts are now maintained at https://github.com/marcuswestin/git-star
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
# See https://github.com/marcuswestin/git-star for new version of this script | |
#!/bin/bash | |
set -e # die on error | |
cd $(git rev-parse --show-toplevel) | |
REMOTE="origin" | |
BRANCH=`git branch --no-color | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` | |
if [ $2 ]; then | |
REMOTE=$1 | |
BRANCH=$2 | |
elif [ $1 ]; then | |
BRANCH=$1 | |
fi | |
echo "Pushing..." | |
git push $REMOTE $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
# See https://github.com/marcuswestin/git-star for new version of this script | |
#!/bin/bash | |
# Usage: gitup [[remote] branch] | |
# Examples: | |
#> gitup | |
#> gitup master | |
#> gitup origin master | |
#> gitup marcuswestin_remote feature_branch | |
set -e # die on error | |
cd $(git rev-parse --show-toplevel) | |
REMOTE="origin" | |
BRANCH=`git branch --no-color | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` | |
if [ $2 ]; then | |
REMOTE=$1 | |
BRANCH=$2 | |
elif [ $1 ]; then | |
BRANCH=$1 | |
fi | |
git checkout $BRANCH | |
echo "Update git repo `pwd` from $REMOTE/$BRANCH" | |
git pull $REMOTE $BRANCH | |
git submodule init | |
git submodule sync | |
git submodule update |
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
# See https://github.com/marcuswestin/git-star for new version of this script | |
#!/bin/bash | |
set -e # die on error | |
cd $(git rev-parse --show-toplevel) | |
REMOTE="origin" | |
BRANCH=`git branch --no-color | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` | |
if [ $2 ]; then | |
REMOTE=$1 | |
BRANCH=$2 | |
elif [ $1 ]; then | |
BRANCH=$1 | |
fi | |
gitup $REMOTE $BRANCH | |
echo "Pushing..." | |
git push $REMOTE $BRANCH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Easy install: