Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. forksync() {
  2. if [ ! -d ".git" ]; then
  3. echo "Make sure your in the root of a github repo."
  4. return
  5. fi
  6. if cat .git/config | grep -q 'remote "upstream"' .git/config; then
  7. git add .
  8. git stash
  9. git fetch upstream
  10. git rebase upstream/master
  11. git stash pop
  12. git add .
  13. git commit -m "forksync"
  14. git push
  15. else
  16. echo "please run the following:"
  17. echo "git remote add upstream git@github.com:username/repo.git"
  18. fi
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement