<?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>bare &#8211; INCD021</title>
	<atom:link href="https://incd021.com/tag/bare/feed/" rel="self" type="application/rss+xml" />
	<link>https://incd021.com</link>
	<description>Programming, thoughts, life  and art.</description>
	<lastBuildDate>Tue, 01 Apr 2025 18:40:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>
	<item>
		<title>Using Git -bare to create local hosted repos</title>
		<link>https://incd021.com/2024/10/27/using-git-bare-to-create-local-hosted-repos/</link>
					<comments>https://incd021.com/2024/10/27/using-git-bare-to-create-local-hosted-repos/#respond</comments>
		
		<dc:creator><![CDATA[INC $D021]]></dc:creator>
		<pubDate>Sun, 27 Oct 2024 17:58:59 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[bare]]></category>
		<category><![CDATA[git]]></category>
		<guid isPermaLink="false">https://incd021.com/?p=775</guid>

					<description><![CDATA[Intro Have you ever wanted to just host your repositories at home instead of handing over everything to some lesser trustworthy third-party site? Then this might be a simple solution....]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">Intro</h3>



<p>Have you ever wanted to just host your repositories at home instead of handing over everything to some lesser trustworthy third-party site? Then this might be a simple solution for you.</p>



<h3 class="wp-block-heading">Setup</h3>



<p>To create the local hosted git repository.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#333545;color:#ebebe6">Markdown</span><span role="button" tabindex="0" data-code="&gt;cd location_for_the_repository
&gt;git init --bare new_local_hosted_repo.git" style="color:#f6f6f4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dracula-soft" style="background-color: #282A36" tabindex="0"><code><span class="line"><span style="color: #E7EE98; font-style: italic">&gt;cd location_for_the_repository</span></span>
<span class="line"><span style="color: #E7EE98; font-style: italic">&gt;git init --bare new_local_hosted_repo.git</span></span></code></pre></div>



<p></p>



<p>This will create a folder ending in .git<br>Now to use it, navigate to where you want to checkout your working directory</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#333545;color:#ebebe6">Markdown</span><span role="button" tabindex="0" data-code="&gt;cd working_directory" style="color:#f6f6f4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dracula-soft" style="background-color: #282A36" tabindex="0"><code><span class="line"><span style="color: #E7EE98; font-style: italic">&gt;cd working_directory</span></span></code></pre></div>



<p></p>



<p>and clone the newly created repository</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#333545;color:#ebebe6">Markdown</span><span role="button" tabindex="0" data-code="&gt;git clone full_path_to_new_local_hosted_repo.git" style="color:#f6f6f4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dracula-soft" style="background-color: #282A36" tabindex="0"><code><span class="line"><span style="color: #E7EE98; font-style: italic">&gt;git clone full_path_to_new_local_hosted_repo.git</span></span></code></pre></div>



<p></p>



<p>The workspace is now ready to use, and you can do all the same things you would normally do, using GitHub, Bitbucket or any other online repository.</p>



<h3 class="wp-block-heading">A Full example:</h3>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#333545;color:#ebebe6">Markdown</span><span role="button" tabindex="0" data-code="&gt;mkdir ~/repositories
&gt;cd ~/repositories
&gt;git init --bare best_game_ever.git
&gt;mkdir ~/workDirectory
&gt;cd ~/workDirectory
&gt;git clone ~/repositories/best_game_ever.git
&gt;cd best_game_ever
&gt;touch ./note.txt
&gt;git add *
&gt;git commit -m &quot;initial commit&quot;
&gt;git push" style="color:#f6f6f4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dracula-soft" style="background-color: #282A36" tabindex="0"><code><span class="line"><span style="color: #E7EE98; font-style: italic">&gt;mkdir ~/repositories</span></span>
<span class="line"><span style="color: #E7EE98; font-style: italic">&gt;cd ~/repositories</span></span>
<span class="line"><span style="color: #E7EE98; font-style: italic">&gt;git init --bare best_game_ever.git</span></span>
<span class="line"><span style="color: #E7EE98; font-style: italic">&gt;mkdir ~/workDirectory</span></span>
<span class="line"><span style="color: #E7EE98; font-style: italic">&gt;cd ~/workDirectory</span></span>
<span class="line"><span style="color: #E7EE98; font-style: italic">&gt;git clone ~/repositories/best_game_ever.git</span></span>
<span class="line"><span style="color: #E7EE98; font-style: italic">&gt;cd best_game_ever</span></span>
<span class="line"><span style="color: #E7EE98; font-style: italic">&gt;touch ./note.txt</span></span>
<span class="line"><span style="color: #E7EE98; font-style: italic">&gt;git add *</span></span>
<span class="line"><span style="color: #E7EE98; font-style: italic">&gt;git commit -m &quot;initial commit&quot;</span></span>
<span class="line"><span style="color: #E7EE98; font-style: italic">&gt;git push</span></span></code></pre></div>



<p></p>



<p><strong>Note</strong>: Remember to backup ~/repositories</p>



<figure class="wp-block-embed is-type-wp-embed is-provider-incd-021 wp-block-embed-incd-021"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="2MqDv7FtSS"><a href="https://incd021.com/disclaimer/">Disclaimer!</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;Disclaimer!&#8221; &#8212; INCD021" src="https://incd021.com/disclaimer/embed/#?secret=jxDRWgSQKJ#?secret=2MqDv7FtSS" data-secret="2MqDv7FtSS" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://incd021.com/2024/10/27/using-git-bare-to-create-local-hosted-repos/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Page Caching using Disk: Enhanced 

Served from: incd021.com @ 2025-05-20 03:33:37 by W3 Total Cache
-->