Is there a way to cache GitHub credentials for pushing commits?

后端 未结 24 3259
囚心锁ツ
囚心锁ツ 2020-11-21 05:02

I recently switched to synchronizing my repositories to https:// on GitHub (due to firewall issues), and it asks for a password every time.

Is there a way to cache t

24条回答
  •  死守一世寂寞
    2020-11-21 05:25

    There's an easy, old-fashioned way to store user credentials in an HTTPS URL:

    https://user:password@github.com/...
    

    You can change the URL with git remote set-url

    The obvious downside to that approach is that you have to store the password in plain text. You can still just enter the user name (https://user@github.com/...) which will at least save you half the hassle.

    You might prefer to switch to SSH or to use the GitHub client software.

提交回复
热议问题