Guest User

Untitled

a guest
Jan 16th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # store the current dir
  4. CUR_DIR=$(pwd)
  5.  
  6. # Let the person running the script know what's going on.
  7. echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
  8.  
  9. # Find all git repositories and update it to the master latest revision
  10. for i in $(find . -name ".git" | cut -c 3-); do
  11. echo "";
  12. echo "\033[33m"+$i+"\033[0m";
  13.  
  14. # We have to go to the .git parent directory to call the pull command
  15. cd "$i";
  16. cd ..;
  17.  
  18. git checkout master
  19. # finally pull
  20. git pull;
  21.  
  22. # lets get back to the CUR_DIR
  23. cd $CUR_DIR
  24. done
  25.  
  26. echo "\n\033[32mComplete!\033[0m\n"
Add Comment
Please, Sign In to add comment