How To Cache Git Credentials
Git repository
Git

If you are using password-based authentication to authenticate yourself to the Git server, it might prompt you to enter your password every time you execute git commands. To avoid that you can configure Git to cache your credential.

In the local Git repository, open .git/config file in a text editor and add the following lines to the end of the file. This configuration will be applied to the current repo only. To apply it globally for all repositories in the local machine, add this configuration to <user.home.dir>/.gitconfig.



[credential]
    helper = store

Instead of using a text editor, you may also use git command to do the above configuration:



# Execute the following from a git repo directory, for global configuration
git config --global credential.helper store

# Execute the following from a git repo directory, applicable to that repo only
git config credential.helper store
How To Cache Git Credentials
Be The First

Join our list to get instant access to new articles and weekly newsletter.

Tagged on:
0 0 votes
Article Rating
Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

[…] Refer to this article on how to cache git credentials. […]

1
0
Would love your thoughts, please comment.x
()
x