How do I avoid the specification of the username and password at every git push?

前端 未结 18 1791
我在风中等你
我在风中等你 2020-11-28 00:02

I git push my work to a remote Git repository.

Every push will prompt me to input username and password. I would

18条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 00:25

    If you already have your SSH keys set up and are still getting the password prompt, make sure your repo URL is in the form

    git+ssh://git@github.com/username/reponame.git
    

    as opposed to

    https://github.com/username/reponame.git
    

    To see your repo URL, run:

    git remote show origin
    

    You can change the URL with git remote set-url like so:

    git remote set-url origin git+ssh://git@github.com/username/reponame.git
    

提交回复
热议问题