v_i_m
v_i_m

Reputation: 171

I want git to ask me everytime for username and password when I push/pull

I just want to disable git from using publickey entirely and start asking me for username and password everytime I push and pull.

How can I do that? Thanks!

Upvotes: 2

Views: 534

Answers (3)

Tarik Manoar
Tarik Manoar

Reputation: 193

Edit (by @tarikmanoar as suggested by moderators and comments)

WARNING: If you use credential.helper store from the answer, your password is going to be stored completely unencrypted ("as is") at ~/.git-credentials. Please consult the comments section below or the answers from the "Linked" section, especially if your employer has zero-tolerance for security issues.

Even though accepted, it doesn't answer the actual OP's question about omitting a username only (no password). For the readers with that exact problem @grawity's answer might come in handy.


Original answer (by @Alexander Zhu):

You can store your credentials using the following command

$ git config credential.helper store
$ git push http://example.com/repo.git
Username: <type your username>
Password: <type your password>

Also, I suggest you read
$ git help credentials

Upvotes: 0

Arjang
Arjang

Reputation: 729

You can have Git store your credentials permanently using the following in your laptop:

git config credential.helper store

If you want Git to resume to asking you for credentials every time it needs to connect to the remote repository, you can run this command:

git config --unset credential.helper

Upvotes: 1

CyberGuy
CyberGuy

Reputation: 2813

Its enough to remove ssh key. Comprehend description can be found here: How to remove a ssh key?

Upvotes: 0

Related Questions