Advertisement
Guest User

GitFunctions

a guest
Dec 12th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.71 KB | None | 0 0
  1. ### Git ########################################################################
  2. GIT_NAME="name";
  3. GIT_EMAIL="mail@domain.com";
  4.  
  5. # Configure my git repository
  6. mygit()
  7. {
  8.     git config user.name $GIT_NAME;
  9.     git config user.email $GIT_EMAIL;
  10.     getgit;
  11. }
  12.  
  13. # Configure git repository
  14. setgit()
  15. {
  16.     if [ -n "$1" ] && [ -n "$2" ]
  17.     then
  18.         git  user.name $1;
  19.         git config user.email $2;
  20.         getgit;
  21.     else
  22.         echo -e "\033[31mUsage: setgit username useremail";
  23.     fi
  24. }
  25.  
  26. # Display git repository configuration
  27. getgit()
  28. {
  29.     echo -e "\033[32mname:  \033[0m`git config user.name`";
  30.     echo -e "\033[32memail: \033[0m`git config user.email`";
  31. }
  32. ################################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement