Guest User

Untitled

a guest
Jun 17th, 2018
68
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 -e "\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 -e "\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. # finally pull
  19. git pull origin master;
  20.  
  21. # lets get back to the CUR_DIR
  22. cd $CUR_DIR
  23. done
  24.  
  25. echo -e "\n\033[32mComplete!\033[0m\n"
Add Comment
Please, Sign In to add comment