Skip to content

Instantly share code, notes, and snippets.

@TonyRenHK
Last active November 10, 2017 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TonyRenHK/f104481b045fde58e767c029b077a662 to your computer and use it in GitHub Desktop.
Save TonyRenHK/f104481b045fde58e767c029b077a662 to your computer and use it in GitHub Desktop.
Push your code to bitbucket direcly
#!/bin/bash
<<'COMMENT'
run : bash Gitshell.sh
COMMENT
echo "~~~~~~~~~~~~~~~~~Fisrt, Clone your repository~~~~~~~~~~~~~~~~~~"
git clone https://username:Password@bitbucket.org/tonyrenhk/YourCodeRepository.git
#Set the time
now="$(date)"
# Call and run nodejs file
node retrieve_salesforce_Class_Page_code.js
echo "*****Finished*******"
# go to your repository folder and then delete related code
cd YourCodeRepository
rm -r "YourProjectName_"
#back to the 'backup' folder and move the code to your repository folder
cd ~/workspace/Backup
mv YourProjectName_ YourCodeRepository
# push your code to the bitbucket
cd YourCodeRepository
#set dynamic variable
R=$$
gitvar="Z"$R
git add -A
git commit -m "$now"
git remote add $gitvar https://username:Password@bitbucket.org/tonyrenhk/YourCodeRepository.git
git push -u $gitvar master
echo "***********************Finsihed Now***************"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment