# debian下配置git永久存储访问凭据 **Published by:** [高同学Daniel](https://paragraph.com/@danielgao/) **Published on:** 2021-12-08 **URL:** https://paragraph.com/@danielgao/debian-git ## Content git config --global credential.helper store 将访问凭据保存到本地。 不过默认是明文保存在磁盘上。可以使用GCM进行加密存储Git Credential ManagerGit Credential Manager (GCM) is another way to store your credentials securely and connect to GitHub over HTTPS. With GCM, you don't have to manually create and store a PAT, as GCM manages authentication on your behalf, including 2FA (two-factor authentication). For Linux, install Git and GCM, then configure Git to use GCM. Install Git from your distro's packaging system. Instructions will vary depending on the flavor of Linux you run. Install GCM. See the instructions in the GCM repo, as they'll vary depending on the flavor of Linux you run. Configure Git to use GCM. There are several backing stores that you may choose from, so see the GCM docs to complete your setup. For more information, see "GCM Linux." The next time you clone an HTTPS URL that requires authentication, Git will prompt you to log in using a browser window. You may first be asked to authorize an OAuth app. If your account or organization requires two-factor auth, you'll also need to complete the 2FA challenge. Once you've authenticated successfully, your credentials are stored on your system and will be used every time you clone an HTTPS URL. Git will not require you to type your credentials in the command line again unless you change your credentials. For more options for storing your credentials on Linux, see Credential Storage in Pro Git. ## Publication Information - [高同学Daniel](https://paragraph.com/@danielgao/): Publication homepage - [All Posts](https://paragraph.com/@danielgao/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@danielgao): Subscribe to updates