<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GitHub &#8211; CJSelvamani</title>
	<atom:link href="https://cjselvamani.com/tag/github/feed/" rel="self" type="application/rss+xml" />
	<link>https://cjselvamani.com</link>
	<description>Saved by Gracious Faith Alone</description>
	<lastBuildDate>Wed, 04 Mar 2026 09:50:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>How to Connect a Private GitHub Repo to cPanel (Step-by-Step)</title>
		<link>https://cjselvamani.com/how-to-connect-a-private-github-repo-to-cpanel-step-by-step/</link>
					<comments>https://cjselvamani.com/how-to-connect-a-private-github-repo-to-cpanel-step-by-step/#respond</comments>
		
		<dc:creator><![CDATA[cjselvamani]]></dc:creator>
		<pubDate>Wed, 04 Mar 2026 09:26:23 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[GitHub]]></category>
		<guid isPermaLink="false">https://cjselvamani.com/?p=939</guid>

					<description><![CDATA[Deploying from GitHub to cPanel can feel tricky at first, especially with SSH keys and [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Deploying from GitHub to cPanel can feel tricky at first, especially with SSH keys and private repositories. This guide walks through a clean setup from scratch.</p>



<h2 class="wp-block-heading">Why use this method?</h2>



<ul class="wp-block-list">
<li>Easy to update after each push</li>



<li>Works with <strong>private</strong> GitHub repos</li>



<li>More secure than manual uploads</li>
</ul>



<h2 class="wp-block-heading">Prerequisites</h2>



<ul class="wp-block-list">
<li>A cPanel account with Terminal/SSH access</li>



<li>A GitHub repository</li>



<li>Domain already pointed to your hosting account</li>
</ul>



<h2 class="wp-block-heading">1. Generate an SSH key on your cPanel server</h2>



<p>In cPanel Terminal:</p>



<pre class="wp-block-code"><code>ssh-keygen -t ed25519 -C "cpanel-deploy" -f ~/.ssh/id_ed25519 -N ""
cat ~/.ssh/id_ed25519.pub</code></pre>



<p>Copy the public key output.</p>



<h2 class="wp-block-heading">2. Add the key to GitHub</h2>



<p>In your GitHub repo:</p>



<ul class="wp-block-list">
<li>Go to <strong>Settings → Deploy keys</strong></li>



<li>Click <strong>Add deploy key</strong></li>



<li>Paste the public key</li>



<li>Keep <strong>write access off</strong> unless you specifically need push from server</li>
</ul>



<p>This allows your server to read your private repo securely.</p>



<h2 class="wp-block-heading">3. Configure SSH on cPanel</h2>



<p>Create/update&nbsp;~/.ssh/config:</p>



<pre class="wp-block-code"><code>Host github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_ed25519
  IdentitiesOnly yes</code></pre>



<p>Then run:</p>



<pre class="wp-block-code"><code>chmod 600 ~/.ssh/config
ssh -T git@github.com</code></pre>



<h2 class="wp-block-heading">4. Clone the repository using SSH</h2>



<p>Use SSH URL (not HTTPS):</p>



<pre class="wp-block-code"><code>cd ~
git clone git@github.com:YOUR_USERNAME/YOUR_REPO.git repositories/your-repo</code></pre>



<h2 class="wp-block-heading">5. Deploy files to your website folder</h2>



<p>Copy repo files to your domain’s document root (example:&nbsp;public_html):</p>



<pre class="wp-block-code"><code>rsync -av --delete ~/repositories/your-repo/ ~/public_html/</code></pre>



<p>Now your site files are live.</p>



<h2 class="wp-block-heading">6. Updating after future GitHub pushes</h2>



<p>When you push new changes:</p>



<pre class="wp-block-code"><code>cd ~/repositories/your-repo
git pull origin main
rsync -av --delete ./ ~/public_html/</code></pre>



<h2 class="wp-block-heading">Common errors and fixes</h2>



<ul class="wp-block-list">
<li>could not read Username for &#8216;https://github.com&#8217;<br>You used HTTPS. Switch remote to SSH.</li>



<li>Permission denied (publickey)<br>Wrong/missing deploy key, or SSH config not using correct key.</li>



<li>Wrong branch (main vs master)<br>Pull the branch that actually exists.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>This setup gives you a secure and repeatable GitHub-to-cPanel deployment flow without making your repository public.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cjselvamani.com/how-to-connect-a-private-github-repo-to-cpanel-step-by-step/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
