Posted By

ericp on 11/19/10


Tagged

Bash git


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

zack


git pull/push bash script


 / Published in: Bash
 

Need to have '[remote "origin"]' set in git config file, and:

  1. In config file
  2. -----------config----------------
  3. ...
  4. [branch "master"]
  5. remote = origin
  6. merge = refs/heads/master
  7. ---------------------------------
  8.  
  9. -------------git.sh--------------
  10. #!/bin/sh
  11.  
  12. f_cleanCache () {
  13. rm css/.sass-cache/ -R
  14. }
  15.  
  16. f_pull () {
  17. git pull origin
  18. }
  19.  
  20. f_push () {
  21. git push origin
  22. }
  23.  
  24. while : # Loop forever
  25. do
  26. cat << !
  27.  
  28. R U N M E N U
  29.  
  30. 1. Pull From Origin
  31. 2. Push To Origin
  32. 3. Quit
  33.  
  34. !
  35.  
  36. echo -n " Your choice? : "
  37. read choice
  38.  
  39. case $choice in
  40. 1) f_pull ;;
  41. 2) f_push ;;
  42. 3) exit ;;
  43. *) echo "\"$choice\" is not valid "; sleep 2 ;;
  44. esac
  45. done

Report this snippet  

You need to login to post a comment.