Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Put this in ~/.bashrc for maximum ease
- github_sync() {
- if [ -z $1 ]; then
- echo "Usage: github_sync branch_name"
- else
- upstream_exists=`git show-ref | grep upstream | wc -l`
- if [[ $upstream_exists -eq 0 ]]; then
- echo "There is no upstream branch. Make sure you run:"
- echo "git remote add upstream https://github.com/___/___.git"
- else
- git fetch upstream $1
- git checkout $1
- git rebase upstream/$1
- git push --force origin master
- fi
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement