I am trying, with a sh file, to commit my changes, enter my git credentials, and push the changes to the branch I'm working on. I can't get the credentials part to work
#!/bin/sh
cd pathtomyrepo
git add *.py
git commit -m "made changes"
git push origin mybranch
mygitusername
echo Press Enter...
mygitpassword
echo Press Enter...
note: I had to run this chmod +x pathtomyshscript.sh
beforehand to be able to run the sh file.
The error I get is:
error: insufficient permission for adding an object to repository database .git/objects fatal: failed to write commit object
Which I presume mean that my credentials were not passed to git. Any suggestion on how to do it? Is it even possible at all?