I git push my work to a remote Git repository.
Every push will prompt me to input username and password. I would
All this arises because git does not provide an option in clone/pull/push/fetch commands to send the credentials through a pipe. Though it gives credential.helper, it stores on the file system or creates a daemon etc. Often, the credentials of GIT are system level ones and onus to keep them safe is on the application invoking the git commands. Very unsafe indeed.
Here is what I had to work around. 1. Git version (git --version) should be greater than or equal to 1.8.3.
GIT CLONE
For cloning, use "git clone URL" after changing the URL from the format, http://{myuser}@{my_repo_ip_address}/{myrepo_name.git} to http://{myuser}:{mypwd}@{my_repo_ip_address}/{myrepo_name.git}
Then purge the repository of the password as in the next section.
PURGING
Now, this would have gone and
If your application is using Java to issue these commands, use ProcessBuilder instead of Runtime. If you must use Runtime, use getRunTime().exec which takes String array as arguments with /bin/bash and -c as arguments rather then the one which takes a single String as argument.
GIT FETCH/PULL/PUSH