How to prevent git from asking for login again


Rafael Castro Cotto

I just created a new git repository and can't do my first push over SSH again without entering my login again.

It asks for my login credentials even though ssh -T [email protected]I'm authenticated .

pydoge

You can use two types of Github or Gitlab links:

SSH link

  • They have the following format:[email protected]:{USERNAME}/{REPOSITORY}.git
  • You have to add SSH keys to the server (Github in this case) to use them.
  • Once the SSH key is added, you will not be asked for a password (since authentication is via the SSH key). If you want to work on multiple computers, you must set up each computer with an SSH key.

HTTPS link

  • They have the following format:https://github.com/{USERNAME}/{REPOSITORY}.git
  • Contrary to SSH links, they do not require any additional setup.
  • They don't handle authentication for you, so they will always ask for a password.

You can reset the remote URL with: git remote set-url origin {LINK}. When you open Github and click Clone or download , pay attention to the Use SSH or Use HTTPS link. This will give you the correct link to the use case.

For quick and dirty work, it's just a click away, or works great when using HTTPS on a borrowed laptop/school computer. If you want to do a lot, or are working from a private computer, SSH setup is more convenient.

See the documentation on how to add SSH keys .

Related


How to prevent git from asking sudo on every git command

Scott I created a directory /var/wwwto store my web app clone directory . When initially cloning the app from GitHub it required me to use sudo, and every time I do this git pullI need sudo. So I have some problems. For example, my ssh keys don't match. So whe

How to prevent git from asking sudo on every git command

Scott I created a directory /var/wwwto store my web app clone directory . When initially cloning the app from GitHub, it required me to use sudo, which is required every time I do this git pull. So I have some problems. For example, my ssh keys don't match. So

How to prevent git from asking sudo on every git command

Scott I created a directory /var/wwwto store my web app clone directory . When initially cloning the app from GitHub it required me to use sudo, and every time I do this git pullI need sudo. So I have some problems. For example, my ssh keys don't match. So whe

How to prevent `sbt dist` from asking for [Enter]?

Schnasers I would like to have a simple copy-paste installation manual for my gaming application. sbt dist cp target/universal/my-app-1.0-SNAPSHOT.zip /tmp unzip my-app-1.0-SNAPSHOT.zip ... Works when copying line by line, but not when pasting as a whole.

How to prevent `sbt dist` from asking for [Enter]?

Schnasers I would like to have a simple copy-paste installation manual for my gaming application. sbt dist cp target/universal/my-app-1.0-SNAPSHOT.zip /tmp unzip my-app-1.0-SNAPSHOT.zip ... Works when copying line by line, but not when pasting as a whole.

How to prevent smbtree from asking for password?

mouse On my Debian system, smbtree(and all other related samba commands) have been requesting some kind of password for my user account. This command works no matter what password is entered. I don't recall ever having a shared password set CIFSanywhere . I di

How to prevent PolicyKit from asking for a password?

scott severance Over the years, my sudoersfiles have the following in them : scott ALL=NOPASSWD: ALL For those who don't know, this prevents asking for a password sudowith friends ( gksudo, etc.). However, over the years, more and more of sudothe things tha

How to prevent PolicyKit from asking for a password?

scott severance Over the years, my sudoersfiles have the following in them : scott ALL=NOPASSWD: ALL For those who don't know, this prevents asking for a password sudowith friends ( gksudo, etc.). However, over the years, more and more of sudothe things tha

How to prevent `sbt dist` from asking for [Enter]?

Schnasers I would like to have a simple copy-paste installation manual for my gaming application. sbt dist cp target/universal/my-app-1.0-SNAPSHOT.zip /tmp unzip my-app-1.0-SNAPSHOT.zip ... Works when copying line by line, but not when pasting as a whole.

How to prevent `sbt dist` from asking for [Enter]?

Schnasers I would like to have a simple copy-paste installation manual for my gaming application. sbt dist cp target/universal/my-app-1.0-SNAPSHOT.zip /tmp unzip my-app-1.0-SNAPSHOT.zip ... Works when copying line by line, but not when pasting as a whole.

How to prevent smbtree from asking for password?

mouse On my Debian system, smbtree(and all other related samba commands) have been requesting some kind of password for my user account. This command works no matter what password is entered. I don't recall ever having a shared password set CIFSanywhere . I di

How to prevent PolicyKit from asking for a password?

scott severance Over the years, my sudoersfiles have the following in them : scott ALL=NOPASSWD: ALL For those who don't know, this prevents asking for a password sudowith friends ( gksudo, etc.). However, over the years, more and more of sudothe things tha

How to prevent new Fragment from being recreated again and again?

stern bafsar Hello i made a simple program in android in which i used 3 Tabs in Tablayout. When I click on the first tab, it opens the first fragment, but when I go to the second tab, when I go back to the first tab, select "recreate" and overwrite my new frag

How to prevent new Fragment from being recreated again and again?

stern bafsar Hello i made a simple program in android in which i used 3 Tabs in Tablayout. When I click on the first tab, it opens the first fragment, but when I go to the second tab, when I go back to the first tab, select "recreate" and overwrite my new frag

How to prevent new Fragment from being recreated again and again?

stern bafsar Hello i made a simple program in android in which i used 3 Tabs in Tablayout. When I click on the first tab, it opens the first fragment, but when I go to the second tab, when I go back to the first tab, select "recreate" and overwrite my new frag

How to prevent vagrant from asking for ssh key passphrase

4c74356b41 Everything works fine, but it's annoying to keep prompting for the ssh password during configuration, and when you have 6 VMs, it prompts you 12 times (the whole automation process is a bit lost). I've tried searching the web but can't find an answe

How can I prevent TortoiseGit from asking me to log in as who?

Troisoff Ok, first of all I've set up the SSH keys, no need to enter a password, it's not another authentication issue ! But I still get asked a question: "Sign in as" in the dialog every time I want to pull or push my code. How do I get rid of it? gentlemen I

How to prevent vagrant from asking for ssh key passphrase

4c74356b41 Everything works fine, but it's annoying to keep prompting for the ssh password during configuration, and when you have 6 VMs, it prompts you 12 times (the whole automation process is a bit lost). I've tried searching the web but can't find an answe

How to prevent vagrant from asking for ssh key passphrase

4c74356b41 Everything works fine, but it's annoying to keep prompting for the ssh password during configuration, and when you have 6 VMs, it prompts you 12 times (the whole automation process is a bit lost). I've tried searching the web but can't find an answe

How can I prevent users from asking the same question twice?

Zach Vande Hey How can I prevent users from asking the same question twice? I already have so they have to end their question with a question mark. Just need to prevent them from asking the same question twice in a row, not necessarily permanently. function Re