{"id":5466,"date":"2024-02-08T14:14:51","date_gmt":"2024-02-08T14:14:51","guid":{"rendered":"https:\/\/puvox.software\/blog\/?p=5466"},"modified":"2024-02-26T08:53:24","modified_gmt":"2024-02-26T08:53:24","slug":"cmd-tortoisegit-solution-for-please-make-sure-you-have-the-correct-access-rights","status":"publish","type":"post","link":"https:\/\/puvox.software\/blog\/cmd-tortoisegit-solution-for-please-make-sure-you-have-the-correct-access-rights\/","title":{"rendered":"[SOLUTION] CMD &#038; TortoiseGit: &#8220;Please make sure you have the correct access rights&#8221;"},"content":{"rendered":"<div class=\"default-content-clss content_5466 type_post \"><h1>Solving CMD authorization for git commands<\/h1>\n<p>&nbsp;<\/p>\n<p>If in your <strong>TortoiseGit<\/strong> GUI everything works well, but when running git commands directly from <strong>CMD<\/strong>, you get<strong>:<\/strong><\/p>\n<pre>git@github.com: Permission denied (publickey).\r\nfatal: Could not read from remote repository.\r\n\r\nPlease make sure you have the correct access rights<\/pre>\n<p>Then one of the possible solutions, you might try is to set &#8220;GIT_SSH&#8221; for terminal (cmd or powershell) session only at first:<\/p>\n<div>\n<pre>\/\/ this is package.json example, just replace \"<strong>reponame\" &amp; \"branchname<\/strong>\"\r\n{\r\n  \"scripts\": {\r\n  \u00a0 \"PULL-MASTER\": \"powershell -Command \\\"$Env:GIT_SSH='C:\\\\Program Files\\\\TortoiseGit\\\\bin\\\\TortoiseGitPlink.exe'; cd c; git.exe pull --progress -v --no-rebase <strong>reponame<\/strong> <strong>branchname<\/strong>\\\"\"\r\n  }\r\n}<\/pre>\n<div><\/div>\n<\/div>\n<p>Warning: do not use any of the following approaches for this case:<\/p>\n<pre>[System.Environment]::SetEnvironmentVariable(\"GIT_SSH\", \"\", \"User\") \/\/ or Machine\r\n \/\/\/\/ or \/\/\/\r\ngit config --global core.sshCommand \"tortoiseplink -agent\" \r\ngit config --global --unset core.sshCommand<\/pre>\n<p>because the first one amends environment variable and second one saves into `%userprofile%\\.gitconfig` file and remove that entry.<\/p>\n<p>&nbsp;<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<div class=\"default-content-clss excerpt_5466 type_post \"><p>Solving CMD authorization for git commands &nbsp; If in your TortoiseGit GUI everything works well, but when running git commands directly from CMD, you get: git@github.com: Permission denied (publickey). fatal:<a class=\"excerpt-read-more\" href=\"https:\/\/puvox.software\/blog\/cmd-tortoisegit-solution-for-please-make-sure-you-have-the-correct-access-rights\/\">(Continue Reading)<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":5471,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[17,11],"tags":[],"class_list":["post-5466","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-coding","category-windows-software"],"_links":{"self":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts\/5466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/comments?post=5466"}],"version-history":[{"count":7,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts\/5466\/revisions"}],"predecessor-version":[{"id":5603,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts\/5466\/revisions\/5603"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/media\/5471"}],"wp:attachment":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/media?parent=5466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/categories?post=5466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/tags?post=5466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}