Git: Any way to set default login credentials?

前端 未结 5 1277
情书的邮戳
情书的邮戳 2021-02-05 23:16

I\'m using terminal for mac and running the line

git push origin master

It asks me for my github.com username and password every time,
is t

5条回答
  •  忘掉有多难
    2021-02-05 23:24

    From your description of things, it sounds like your [Project Dir]/.git/config file is setup with the line url = https..., and not url = git@github.com.... Can you check that file to see what it says? It'd be great if you could post your entire "remote origin" section. It probably looks something like this:

    [remote "origin"]
        url = https://github.com/atheycreek/churchdeploy.git
        fetch = +refs/heads/*:refs/remotes/origin/*
    

    but needs to use ssh instead of http like this:

    [remote "origin"]
        url = git@github.com:atheycreek/churchdeploy.git
        fetch = +refs/heads/*:refs/remotes/origin/*
    

提交回复
热议问题