<?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; My Shitty Code</title>
	<atom:link href="https://myshittycode.com/tag/github/feed/" rel="self" type="application/rss+xml" />
	<link>https://myshittycode.com</link>
	<description>Embracing the Messiness in Search of Epic Solutions</description>
	<lastBuildDate>Fri, 06 Jan 2023 16:44:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://myshittycode.com/wp-content/uploads/2022/04/cropped-icon-32x32.png</url>
	<title>Github &#8211; My Shitty Code</title>
	<link>https://myshittycode.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">205304208</site>	<item>
		<title>GitHub: Key is Already in Use</title>
		<link>https://myshittycode.com/2022/11/23/github-key-is-already-in-use/</link>
					<comments>https://myshittycode.com/2022/11/23/github-key-is-already-in-use/#comments</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Wed, 23 Nov 2022 14:12:50 +0000</pubDate>
				<category><![CDATA[Development Tools]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[SSH]]></category>
		<guid isPermaLink="false">https://myshittycode.com/?p=1974</guid>

					<description><![CDATA[<p>PROBLEM When trying to add a SSH key in GitHub, an error &#8220;Key is already in use&#8221; is thrown even though you signed into GitHub using a different user account. SOLUTION The error occurs when the same SSH key has been added to a different account. This typically happens when you already have an existing [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2022/11/23/github-key-is-already-in-use/">GitHub: Key is Already in Use</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">PROBLEM</h2>



<p>When trying to add a SSH key in GitHub, an error &#8220;Key is already in use&#8221; is thrown even though you signed into GitHub using a different user account.</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="135" src="https://myshittycode.com/wp-content/uploads/2022/11/github-key-in-use-1024x135.png?x45560" alt="" class="wp-image-1975" srcset="https://myshittycode.com/wp-content/uploads/2022/11/github-key-in-use-1024x135.png 1024w, https://myshittycode.com/wp-content/uploads/2022/11/github-key-in-use-300x40.png 300w, https://myshittycode.com/wp-content/uploads/2022/11/github-key-in-use-768x102.png 768w, https://myshittycode.com/wp-content/uploads/2022/11/github-key-in-use-1536x203.png 1536w, https://myshittycode.com/wp-content/uploads/2022/11/github-key-in-use.png 1740w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



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



<p>The error occurs when <a href="https://docs.github.com/en/authentication/troubleshooting-ssh/error-key-already-in-use" target="_blank" rel="noopener">the same SSH key has been added to a different account</a>. This typically happens when you already have an existing personal GitHub account and you are trying to use the same SSH key in a work-related GitHub Enterprise account.</p>



<p>The fix is to use a new SSH key. When generating the SSH key using <strong>ssh-keygen</strong>, remember NOT to override the existing ~/.ssh/id_rsa. Rather, use a different file path, such as ~/.ssh/id_rsa_github_enterprise. </p>



<p>To ensure seamless integration when doing a git clone, add the following configuration in ~/.ssh/config.  </p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
Host github.com
  Hostname github.com
  User git
  IdentityFile ~/.ssh/id_rsa

Host github-enterprise.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa_github_enterprise
</pre></div>


<p>The first block ensures it doesn&#8217;t break the existing GitHub connectivity using the default SSH key.</p>



<p>The second block allows a different SSH key to be used when connecting to GitHub.  In order to leverage this configuration, the host name needs to be tweaked when doing a git clone.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
# Don&#039;t do this because this will use ~/.ssh/id_rsa
git clone git@github.com:shitty_user/shitty_repo.git 

# Do this instead to use the new SSH key
git clone git@github-enterprise.com:shitty_user/shitty_repo.git 
</pre></div>


<p></p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2022/11/23/github-key-is-already-in-use/">GitHub: Key is Already in Use</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2022/11/23/github-key-is-already-in-use/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1974</post-id>	</item>
		<item>
		<title>JaCoCo Web Report Not Rendering Properly in GitHub Pages</title>
		<link>https://myshittycode.com/2015/07/22/jacoco-web-report-not-rendering-properly-in-github-pages/</link>
					<comments>https://myshittycode.com/2015/07/22/jacoco-web-report-not-rendering-properly-in-github-pages/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Wed, 22 Jul 2015 23:08:30 +0000</pubDate>
				<category><![CDATA[Development Tools]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[JaCoCo Maven Plugin]]></category>
		<category><![CDATA[Maven]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=767</guid>

					<description><![CDATA[<p>PROBLEM When pushing JaCoCo web report to GitHub&#8217;s gh-pages branch, it does not render properly on the web. For example:- The GitHub pages are powered by Jekyll. By default, Jekyll does not allow directories or files that begin with a dot, pound sign, tilde or underscore. Since JaCoCo places all the image and CSS files [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2015/07/22/jacoco-web-report-not-rendering-properly-in-github-pages/">JaCoCo Web Report Not Rendering Properly in GitHub Pages</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">PROBLEM</h2>



<p>When pushing JaCoCo web report to GitHub&#8217;s gh-pages branch, it does not render properly on the web. For example:-</p>



<figure class="wp-block-image aligncenter"><img decoding="async" width="2194" height="468" src="https://myshittycode.com/wp-content/uploads/2015/07/screen-shot-2015-07-22-at-4-34-15-pm-1.png?x45560" alt="" class="wp-image-769" srcset="https://myshittycode.com/wp-content/uploads/2015/07/screen-shot-2015-07-22-at-4-34-15-pm-1.png 2194w, https://myshittycode.com/wp-content/uploads/2015/07/screen-shot-2015-07-22-at-4-34-15-pm-1-300x64.png 300w, https://myshittycode.com/wp-content/uploads/2015/07/screen-shot-2015-07-22-at-4-34-15-pm-1-1024x218.png 1024w, https://myshittycode.com/wp-content/uploads/2015/07/screen-shot-2015-07-22-at-4-34-15-pm-1-768x164.png 768w, https://myshittycode.com/wp-content/uploads/2015/07/screen-shot-2015-07-22-at-4-34-15-pm-1-1536x328.png 1536w, https://myshittycode.com/wp-content/uploads/2015/07/screen-shot-2015-07-22-at-4-34-15-pm-1-2048x437.png 2048w" sizes="(max-width: 2194px) 100vw, 2194px" /></figure>



<p>The GitHub pages are powered by <a href="http://jekyllrb.com/docs/github-pages/" target="_blank" rel="noopener">Jekyll</a>. By default, Jekyll does not allow directories or files that begin with a dot, pound sign, tilde or underscore.</p>



<p>Since JaCoCo places all the image and CSS files in a directory called <b>.resources</b>, this directory will not be pushed to GitHub&#8217;s gh-pages branch.</p>



<h2 class="wp-block-heading">SOLUTION UPDATE: 2015-07-23</h2>



<p><a href="https://github.github.com/maven-plugins/site-plugin/site-mojo.html" target="_blank" rel="noopener">GitHub Site Plugin</a> has a <b>noJekyll</b> parameter that will create the <b>.nojekyll</b> file at the root path if it is set to <b>true</b>.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; highlight: [8]; title: ; notranslate">
&lt;plugin&gt;
    &lt;groupid&gt;com.github.github&lt;/groupid&gt;
    &lt;artifactid&gt;site-maven-plugin&lt;/artifactid&gt;
    &lt;version&gt;${site-maven-plugin.version}&lt;/version&gt;
    &lt;configuration&gt;
        &lt;message&gt;Creating site for ${project.version}&lt;/message&gt;
        &lt;server&gt;github&lt;/server&gt;
        &lt;nojekyll&gt;true&lt;/nojekyll&gt;
    &lt;/configuration&gt;
    &lt;executions&gt;
        &lt;execution&gt;
            &lt;goals&gt;
                &lt;goal&gt;site&lt;/goal&gt;
            &lt;/goals&gt;
            &lt;phase&gt;site&lt;/phase&gt;
        &lt;/execution&gt;
    &lt;/executions&gt;
&lt;/plugin&gt;
</pre></div>


<h2 class="wp-block-heading">SOLUTION 1: Disable Jekyll</h2>



<p>One simple fix is to completely disable Jekyll by creating an empty file called <b>.nojekyll</b> at this location:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; highlight: [7,8,9]; title: ; notranslate">
myproject
├── pom.xml
├── src
│   ├── main
│   │   └── java
│   │       └── ...
│   ├── site
│   │   └── resources
│   │       └── .nojekyll
</pre></div>


<h2 class="wp-block-heading">SOLUTION 2: Configure Jekyll</h2>



<p>While disabling Jekyll works, it may 1) seem rather risky since there maybe other hidden directories/files and 2) possibly send too much garbage to GitHub&#8217;s gh-pages branch.</p>



<p>To fix this, we will instruct Jekyll to allow JaCoCo&#8217;s <b>.resources</b> directory through by creating a file called <b>_config.yml</b> at this location:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; highlight: [7,8,9]; title: ; notranslate">
myproject
├── pom.xml
├── src
│   ├── main
│   │   └── java
│   │       └── ...
│   ├── site
│   │   └── resources
│   │       └── _config.yml
</pre></div>


<p>In <b>_config.yml</b>, enter the following:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: ruby; title: ; notranslate">
# Allow JaCoCo&#039;s directory to bypass GitHub&#039;s Jekyll-powered pages
# so that the web report renders properly
include: &#x5B;&#039;.resources&#039;]
</pre></div>


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



<p>Either solution will produce a nicely rendered JaCoCo web report in GitHub pages.</p>



<figure class="wp-block-image aligncenter"><img decoding="async" width="2496" height="324" src="https://myshittycode.com/wp-content/uploads/2015/07/screen-shot-2015-07-22-at-5-16-18-pm-1.png?x45560" alt="" class="wp-image-770" srcset="https://myshittycode.com/wp-content/uploads/2015/07/screen-shot-2015-07-22-at-5-16-18-pm-1.png 2496w, https://myshittycode.com/wp-content/uploads/2015/07/screen-shot-2015-07-22-at-5-16-18-pm-1-300x39.png 300w, https://myshittycode.com/wp-content/uploads/2015/07/screen-shot-2015-07-22-at-5-16-18-pm-1-1024x133.png 1024w, https://myshittycode.com/wp-content/uploads/2015/07/screen-shot-2015-07-22-at-5-16-18-pm-1-768x100.png 768w, https://myshittycode.com/wp-content/uploads/2015/07/screen-shot-2015-07-22-at-5-16-18-pm-1-1536x199.png 1536w, https://myshittycode.com/wp-content/uploads/2015/07/screen-shot-2015-07-22-at-5-16-18-pm-1-2048x266.png 2048w" sizes="(max-width: 2496px) 100vw, 2496px" /></figure>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2015/07/22/jacoco-web-report-not-rendering-properly-in-github-pages/">JaCoCo Web Report Not Rendering Properly in GitHub Pages</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2015/07/22/jacoco-web-report-not-rendering-properly-in-github-pages/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">767</post-id>	</item>
		<item>
		<title>Maven: Deploying Generated Site to GitHub</title>
		<link>https://myshittycode.com/2015/05/05/maven-deploying-generated-site-to-github/</link>
					<comments>https://myshittycode.com/2015/05/05/maven-deploying-generated-site-to-github/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Wed, 06 May 2015 01:24:00 +0000</pubDate>
				<category><![CDATA[Development Tools]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[Maven]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=703</guid>

					<description><![CDATA[<p>INTRO GitHub provides an incredible feature that allows us to easily push Maven generated site to our project&#8217;s GitHub repository. Here&#8217;s how to do it&#8230; STEP 1: Define GitHub credential Go to ~/.m2/settings.xml and add your GitHub username and password:- STEP 2: Define GitHub&#8217;s site-maven-plugin GitHub provides its own site-maven-plugin that can be used to [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2015/05/05/maven-deploying-generated-site-to-github/">Maven: Deploying Generated Site to GitHub</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">INTRO</h2>



<p>GitHub provides an incredible feature that allows us to easily push Maven generated site to our project&#8217;s GitHub repository.</p>



<p>Here&#8217;s how to do it&#8230;</p>



<h2 class="wp-block-heading">STEP 1: Define GitHub credential</h2>



<p>Go to <b>~/.m2/settings.xml</b> and add your GitHub username and password:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; highlight: [2,3,4,5,6,7,8]; title: ; notranslate">
&lt;settings ...=&quot;&quot;&gt;
	&lt;servers&gt;
		&lt;server&gt;
			&lt;id&gt;github&lt;/id&gt;
			&lt;username&gt;USERNAME&lt;/username&gt;
			&lt;password&gt;PASSWORD&lt;/password&gt;
		&lt;/server&gt;
	&lt;/servers&gt;
&lt;/settings&gt;
</pre></div>


<h2 class="wp-block-heading">STEP 2: Define GitHub&#8217;s site-maven-plugin</h2>



<p>GitHub provides its own site-maven-plugin that can be used to deploy a Maven generated site to a <b>gh-pages</b> branch so that it can be served statically as a GitHub Project Page.</p>



<p>In <b>pom.xml</b>, add the following plugin configuration:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; highlight: [6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]; title: ; notranslate">
&lt;project ...=&quot;&quot;&gt;
    ...
    &lt;build&gt;
        &lt;plugins&gt;
            ...
            &lt;plugin&gt;
                &lt;groupid&gt;com.github.github&lt;/groupid&gt;
                &lt;artifactid&gt;site-maven-plugin&lt;/artifactid&gt;
                &lt;version&gt;0.11&lt;/version&gt;
                &lt;configuration&gt;
                    &lt;message&gt;Creating site for ${project.version}&lt;/message&gt;
                    &lt;server&gt;github&lt;/server&gt;
                &lt;/configuration&gt;
                &lt;executions&gt;
                    &lt;execution&gt;
                        &lt;goals&gt;
                            &lt;goal&gt;site&lt;/goal&gt;
                        &lt;/goals&gt;
                        &lt;phase&gt;site&lt;/phase&gt;
                    &lt;/execution&gt;
                &lt;/executions&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
    &lt;/build&gt;
    ...
&lt;/project&gt;
</pre></div>


<h2 class="wp-block-heading">STEP 3: Define project URL</h2>



<p>In <b>pom.xml</b>, define <b>&lt;url&gt;</b> tag that points to the project&#8217;s GitHub repository.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; highlight: [5]; title: ; notranslate">
&lt;project ...=&quot;&quot;&gt;
    &lt;groupid&gt;...&lt;/groupid&gt;
    &lt;artifactid&gt;...&lt;/artifactid&gt;
    &lt;version&gt;...&lt;/version&gt;
    &lt;url&gt;https://github.com/USERNAME/PROJECT-NAME&lt;/url&gt;
	...
&lt;/project&gt;
</pre></div>


<p>If this is not defined, Maven will throw the following error when executing <b>mvn clean site</b>:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; highlight: [5]; title: ; notranslate">
Failed to execute goal com.github.github:site-maven-plugin:0.11:site
(default) on project PROJECT-NAME: No GitHub repository (owner and
name) configured -&amp;amp;gt; &#x5B;Help 1]
</pre></div>


<h2 class="wp-block-heading">STEP 4: Generate Maven site and push to GitHub</h2>



<p>Finally, run the following command: <b>mvn clean site</b>.</p>



<p>The generated site can be viewed from https://USERNAME.github.io/PROJECT-NAME/ .</p>



<p>That&#8217;s it&#8230;. very simple.</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2015/05/05/maven-deploying-generated-site-to-github/">Maven: Deploying Generated Site to GitHub</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2015/05/05/maven-deploying-generated-site-to-github/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">703</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching using Disk

Served from: myshittycode.com @ 2026-02-19 08:35:30 by W3 Total Cache
-->