1

How can I run the following command in one command line?

prompt> git pull user password

We are using a shared machine in which each user can log in and build his branch. Since it is a shared machine, we do not want to store my credentials in the global configuration. Currently git pull expects user and password in new lines and I hope we can do it in one command line.

ZygD
  • 22,092
  • 39
  • 79
  • 102
fredy
  • 575
  • 2
  • 9
  • 20
  • 2
    Use SSH keys for authentication instead. – Ry- Apr 01 '15 at 21:42
  • Thanks. 1. since i'm not a unix sysadmin, can you give an example how to do it? 2. Does this command line exists (simple solution)? – fredy Apr 02 '15 at 02:16

1 Answers1

0

You can use this with HTTPS

git pull https://user:password@alpha.com/bravo/charlie

However be careful, this method can store credentials in ~/.bash_history or similar.

How to prevent commands to show up in bash history?

Community
  • 1
  • 1
Zombo
  • 1
  • 62
  • 391
  • 407
  • Also note that program arguments may be available by default to other users (check `ps`). – Ry- Apr 02 '15 at 02:30