Username and password in command for git push


It’s possible to clone down a git repository, specifying username and password in the command. Example:

git clone

Is it is possible to also specify the username and password when pushing? So that, for example, running git push origin --all will then output asking for a password. I want this in one command.

(I am aware of the ability to set up keys and other solutions, but I want to know if there is a way to just keep using username and password with one command.) I am running Git Bash on Windows 8.1.


Yes, you can do

git push --all

in this case replace the origin in git push origin --all

To see more options for git push, try git help push

Leave a Reply