Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forksync() {
- if [ ! -d ".git" ]; then
- echo "Make sure your in the root of a github repo."
- return
- fi
- if cat .git/config | grep -q 'remote "upstream"' .git/config; then
- git add .
- git stash
- git fetch upstream
- git rebase upstream/master
- git stash pop
- git add .
- git commit -m "forksync"
- git push
- else
- echo "please run the following:"
- echo "git remote add upstream git@github.com:username/repo.git"
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement