{"id":4541,"date":"2025-06-18T11:09:06","date_gmt":"2025-06-18T05:39:06","guid":{"rendered":"https:\/\/hostathash.com\/blog\/?p=4541"},"modified":"2025-06-18T11:12:57","modified_gmt":"2025-06-18T05:42:57","slug":"how-to-connect-and-use-github-with-directadmin-git-feature","status":"publish","type":"post","link":"https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/","title":{"rendered":"How to connect and use github with DirectAdmin git feature"},"content":{"rendered":"<p>How to connect git with DirectAdmin<\/p>\n<p>Login into SSH and run the following command to create a new key pair<\/p>\n<blockquote><p>-ssh-keygen -t rsa -b 4096 -C &#8220;email@example.com&#8221;<\/p><\/blockquote>\n<p>When prompted for file location, press Enter to accept default (~\/.ssh\/id_rsa).<br \/>\nSet a passphrase or press Enter to skip it.<\/p>\n<p>Add your SSH key to the SSH agent<\/p>\n<blockquote><p>eval &#8220;$(ssh-agent -s)&#8221;<br \/>\nssh-add ~\/.ssh\/id_rsa<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>Show the public key:<\/p>\n<blockquote><p>cat ~\/.ssh\/id_rsa.pub<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>Copy the entire output.<br \/>\nGo to GitHub \u2192 Settings \u2192 SSH and GPG Keys \u2192 New SSH Key.<br \/>\nPaste the key and save.<\/p>\n<p>Run the below command to secure SSH private key.<\/p>\n<blockquote><p>chmod 600 ~\/.ssh\/id_rsa<\/p><\/blockquote>\n<p>Run the following command in terminal to check connection of server with github account<\/p>\n<blockquote><p>ssh -T -i \/home\/sufiyans\/newprivatekey git@github.com<\/p><\/blockquote>\n<p>OUTPUT<br \/>\nHi Sufiyanshaikh123! You&#8217;ve successfully authenticated, but GitHub does not provide shell access.<\/p>\n<p>&nbsp;<\/p>\n<p>CLONE REPOSITORY<\/p>\n<blockquote><p>GIT_SSH_COMMAND=&#8217;ssh -i \/home\/sufiyans\/newprivatekey&#8217; git clone git@github.com:Sufiyanshaikh123\/whmcshooks.git<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>Clone into current directory without creating new folder<\/p>\n<blockquote><p>GIT_SSH_COMMAND=&#8217;ssh -i \/home\/sufiyans\/newprivatekey&#8217; git clone git@github.com:Sufiyanshaikh123\/whmcshooks.git .<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>Pull sync only the new changes in the repo. If you have deleted any file intentionally, it won&#8217;t download it from repo again.<\/p>\n<blockquote><p>GIT_SSH_COMMAND=&#8217;ssh -i \/home\/sufiyans\/newprivatekey&#8217; git pull<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>Pull again from repo and also restore the deleted file.<\/p>\n<blockquote><p>GIT_SSH_COMMAND=&#8217;ssh -i \/home\/sufiyans\/newprivatekey&#8217; git fetch origin<\/p><\/blockquote>\n<hr \/>\n<p>The below command will:<br \/>\nFetch the latest changes from GitHub.<br \/>\nForce your working directory to match the remote exactly.<br \/>\nErase any uncommitted local changes or deletions.<\/p>\n<blockquote><p>git reset &#8211;hard origin\/main<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to connect git with DirectAdmin Login into SSH and run the following command to create a new key pair &#8230; <a title=\"How to connect and use github with DirectAdmin git feature\" class=\"read-more\" href=\"https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[489,522],"tags":[],"class_list":["post-4541","post","type-post","status-publish","format-standard","hentry","category-directadmin","category-git"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to connect and use github with DirectAdmin git feature - HostatHash<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to connect and use github with DirectAdmin git feature - HostatHash\" \/>\n<meta property=\"og:description\" content=\"How to connect git with DirectAdmin Login into SSH and run the following command to create a new key pair ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/\" \/>\n<meta property=\"og:site_name\" content=\"HostatHash\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hostathash\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-18T05:39:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-18T05:42:57+00:00\" \/>\n<meta name=\"author\" content=\"Sufiyan Shaikh\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hostathash\" \/>\n<meta name=\"twitter:site\" content=\"@hostathash\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sufiyan Shaikh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/how-to-connect-and-use-github-with-directadmin-git-feature\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/how-to-connect-and-use-github-with-directadmin-git-feature\\\/\"},\"author\":{\"name\":\"Sufiyan Shaikh\",\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/#\\\/schema\\\/person\\\/16f0e6dd4cf0429469e00835dfe7a8b7\"},\"headline\":\"How to connect and use github with DirectAdmin git feature\",\"datePublished\":\"2025-06-18T05:39:06+00:00\",\"dateModified\":\"2025-06-18T05:42:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/how-to-connect-and-use-github-with-directadmin-git-feature\\\/\"},\"wordCount\":289,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/#organization\"},\"articleSection\":[\"DirectAdmin\",\"Git\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/hostathash.com\\\/blog\\\/how-to-connect-and-use-github-with-directadmin-git-feature\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/how-to-connect-and-use-github-with-directadmin-git-feature\\\/\",\"url\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/how-to-connect-and-use-github-with-directadmin-git-feature\\\/\",\"name\":\"How to connect and use github with DirectAdmin git feature - HostatHash\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/#website\"},\"datePublished\":\"2025-06-18T05:39:06+00:00\",\"dateModified\":\"2025-06-18T05:42:57+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/how-to-connect-and-use-github-with-directadmin-git-feature\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hostathash.com\\\/blog\\\/how-to-connect-and-use-github-with-directadmin-git-feature\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/how-to-connect-and-use-github-with-directadmin-git-feature\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to connect and use github with DirectAdmin git feature\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/\",\"name\":\"HostatHash\",\"description\":\"Web hosting solution\",\"publisher\":{\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/#organization\",\"name\":\"HostatHash\",\"url\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"HostatHash\"},\"image\":{\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hostathash\",\"https:\\\/\\\/x.com\\\/hostathash\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/#\\\/schema\\\/person\\\/16f0e6dd4cf0429469e00835dfe7a8b7\",\"name\":\"Sufiyan Shaikh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2c8994d6a93d0d01ace382e7baa6c864c72dd6d40b4b4843a407a535c2b2373c?s=96&d=wp_user_avatar&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2c8994d6a93d0d01ace382e7baa6c864c72dd6d40b4b4843a407a535c2b2373c?s=96&d=wp_user_avatar&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2c8994d6a93d0d01ace382e7baa6c864c72dd6d40b4b4843a407a535c2b2373c?s=96&d=wp_user_avatar&r=g\",\"caption\":\"Sufiyan Shaikh\"},\"url\":\"https:\\\/\\\/hostathash.com\\\/blog\\\/author\\\/hostathash\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to connect and use github with DirectAdmin git feature - HostatHash","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/","og_locale":"en_US","og_type":"article","og_title":"How to connect and use github with DirectAdmin git feature - HostatHash","og_description":"How to connect git with DirectAdmin Login into SSH and run the following command to create a new key pair ... Read more","og_url":"https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/","og_site_name":"HostatHash","article_publisher":"https:\/\/www.facebook.com\/hostathash","article_published_time":"2025-06-18T05:39:06+00:00","article_modified_time":"2025-06-18T05:42:57+00:00","author":"Sufiyan Shaikh","twitter_card":"summary_large_image","twitter_creator":"@hostathash","twitter_site":"@hostathash","twitter_misc":{"Written by":"Sufiyan Shaikh","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/#article","isPartOf":{"@id":"https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/"},"author":{"name":"Sufiyan Shaikh","@id":"https:\/\/hostathash.com\/blog\/#\/schema\/person\/16f0e6dd4cf0429469e00835dfe7a8b7"},"headline":"How to connect and use github with DirectAdmin git feature","datePublished":"2025-06-18T05:39:06+00:00","dateModified":"2025-06-18T05:42:57+00:00","mainEntityOfPage":{"@id":"https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/"},"wordCount":289,"commentCount":0,"publisher":{"@id":"https:\/\/hostathash.com\/blog\/#organization"},"articleSection":["DirectAdmin","Git"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/","url":"https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/","name":"How to connect and use github with DirectAdmin git feature - HostatHash","isPartOf":{"@id":"https:\/\/hostathash.com\/blog\/#website"},"datePublished":"2025-06-18T05:39:06+00:00","dateModified":"2025-06-18T05:42:57+00:00","breadcrumb":{"@id":"https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/hostathash.com\/blog\/how-to-connect-and-use-github-with-directadmin-git-feature\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hostathash.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to connect and use github with DirectAdmin git feature"}]},{"@type":"WebSite","@id":"https:\/\/hostathash.com\/blog\/#website","url":"https:\/\/hostathash.com\/blog\/","name":"HostatHash","description":"Web hosting solution","publisher":{"@id":"https:\/\/hostathash.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hostathash.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/hostathash.com\/blog\/#organization","name":"HostatHash","url":"https:\/\/hostathash.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hostathash.com\/blog\/#\/schema\/logo\/image\/","url":"","contentUrl":"","caption":"HostatHash"},"image":{"@id":"https:\/\/hostathash.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hostathash","https:\/\/x.com\/hostathash"]},{"@type":"Person","@id":"https:\/\/hostathash.com\/blog\/#\/schema\/person\/16f0e6dd4cf0429469e00835dfe7a8b7","name":"Sufiyan Shaikh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2c8994d6a93d0d01ace382e7baa6c864c72dd6d40b4b4843a407a535c2b2373c?s=96&d=wp_user_avatar&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2c8994d6a93d0d01ace382e7baa6c864c72dd6d40b4b4843a407a535c2b2373c?s=96&d=wp_user_avatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2c8994d6a93d0d01ace382e7baa6c864c72dd6d40b4b4843a407a535c2b2373c?s=96&d=wp_user_avatar&r=g","caption":"Sufiyan Shaikh"},"url":"https:\/\/hostathash.com\/blog\/author\/hostathash\/"}]}},"_links":{"self":[{"href":"https:\/\/hostathash.com\/blog\/wp-json\/wp\/v2\/posts\/4541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostathash.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostathash.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostathash.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hostathash.com\/blog\/wp-json\/wp\/v2\/comments?post=4541"}],"version-history":[{"count":5,"href":"https:\/\/hostathash.com\/blog\/wp-json\/wp\/v2\/posts\/4541\/revisions"}],"predecessor-version":[{"id":4546,"href":"https:\/\/hostathash.com\/blog\/wp-json\/wp\/v2\/posts\/4541\/revisions\/4546"}],"wp:attachment":[{"href":"https:\/\/hostathash.com\/blog\/wp-json\/wp\/v2\/media?parent=4541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostathash.com\/blog\/wp-json\/wp\/v2\/categories?post=4541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostathash.com\/blog\/wp-json\/wp\/v2\/tags?post=4541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}