{"id":7,"date":"2019-07-15T11:59:14","date_gmt":"2019-07-15T11:59:14","guid":{"rendered":"https:\/\/openapex.org\/spaces\/software\/?p=7"},"modified":"2023-01-03T18:56:21","modified_gmt":"2023-01-03T13:26:21","slug":"avoid-entering-git-credentials-every-time","status":"publish","type":"post","link":"https:\/\/mutesoft.com\/spaces\/software\/avoid-entering-git-credentials-every-time.html","title":{"rendered":"How To Cache Git Credentials"},"content":{"rendered":"\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2022\/02\/git-e1672746066670.png\" alt=\"Git repository\"\/><figcaption class=\"wp-element-caption\">Git<\/figcaption><\/figure>\n\n\n\n<p>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 <code>git<\/code> commands. To avoid that you can configure <code>Git<\/code> to cache your credential.<\/p>\n\n\n\n<p>In the local Git repository, open <code>.git\/config<\/code> 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 <code>&lt;user.home.dir&gt;\/.gitconfig<\/code>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"ini\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[credential]\n    helper = store<\/pre>\n\n\n\n<p>Instead of using a text editor, you may also use <code>git<\/code> command to do the above configuration:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Execute the following from a git repo directory, for global configuration\ngit config --global credential.helper store\n\n# Execute the following from a git repo directory, applicable to that repo only\ngit config credential.helper store<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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.<\/p>\n","protected":false},"author":2,"featured_media":1053,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"none","_seopress_titles_title":"","_seopress_titles_desc":"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.","_seopress_robots_index":"","_vp_format_video_url":"","_vp_image_focal_point":[],"footnotes":""},"categories":[32],"tags":[31],"class_list":["post-7","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tools","tag-git"],"_links":{"self":[{"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/posts\/7","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/comments?post=7"}],"version-history":[{"count":12,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":1372,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/posts\/7\/revisions\/1372"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/media\/1053"}],"wp:attachment":[{"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/media?parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/categories?post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/tags?post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}