Caching your GitHub credentials in Git

Git username๊ณผ password๋ฅผ ์ž…๋ ฅํ•˜๊ธฐ ๊ท€์ฐฎ์€ ๋‚˜ ๊ฐ™์€ ๋ˆ„๊ตฐ๊ฐ€๋ฅผ ์œ„ํ•œ ์งง์€ ๊ธ€

Reference: github docs

1. Turn on credential helper

$ git config --global credential.helper cache
  • credential helper๊ฐ€ ์ž…๋ ฅํ•œ password๋ฅผ ์ €์žฅํ•ด๋†“๋Š”๋‹ค.

  • default๋กœ 15๋ถ„๋™์•ˆ ์ €์žฅ๋˜์ง€๋งŒ, ๋ณ€๊ฒฝ์„ ์›ํ•˜๋ฉด ์•„๋ž˜์˜ ๋ช…๋ น์œผ๋กœ ์ €์žฅ๋˜๋Š” ์‹œ๊ฐ„์„ ๋ฐ”๊พธ๋ฉด ๋œ๋‹ค

2. Change the default password cache timeout

 $ git config --global credential.helper 'cache --timeout 3600'
  • An hour - 3600

  • 1 day - 86,400

  • 7 days - 604,800

  • 30 days - 2,592,000

Last updated