Guest User

Untitled

a guest
Jan 23rd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 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[1mCommitting all the 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. dir=$(dirname "$i");
  12. echo ${dir};
  13.  
  14. echo "";
  15. echo "\033[33m"+${dir}+"\033[0m";
  16.  
  17. # We have to go to the .git parent directory to call the add and commit commands
  18. cd "${dir}";
  19. git add --all && git commit -m "Adding new changes";
  20.  
  21. # finally pull
  22. git pull origin master;
  23.  
  24. # lets get back to the CUR_DIR
  25. cd $CUR_DIR
  26. done
  27.  
  28. echo "\n\033[32mComplete!\033[0m\n"
Add Comment
Please, Sign In to add comment