Guest User

Untitled

a guest
Jul 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. # HACK
  2.  
  3. TO_HACK_WITH=$1
  4. CURRENT=`git branch | grep '\*' | awk '{print $2}'`
  5. if [ -z $TO_HACK_WITH ]; then
  6. echo "First argument has to be one of these branches:"
  7. git branch | grep -v $CURRENT
  8. exit 1
  9. fi
  10.  
  11. STATUS=`git checkout $TO_HACK_WITH | awk '{print $1}'`
  12. if [[ "${STATUS}" =~ error ]]; then
  13. echo "Something went terribly wrong! ${STATUS}"
  14. git checkout $CURRENT
  15. exit 1
  16. fi
  17. git pull && \
  18. git checkout $CURRENT && \
  19. git rebase $TO_HACK_WITH
Add Comment
Please, Sign In to add comment