<?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>Git &#8211; My Shitty Code</title>
	<atom:link href="https://myshittycode.com/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>https://myshittycode.com</link>
	<description>Embracing the Messiness in Search of Epic Solutions</description>
	<lastBuildDate>Mon, 20 May 2024 14:01:22 +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>Git &#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>Git LFS: &#8220;Certificate Signed by Unknown Authority&#8221; Error</title>
		<link>https://myshittycode.com/2024/05/20/git-lfs-certificate-signed-by-unknown-authority-error/</link>
					<comments>https://myshittycode.com/2024/05/20/git-lfs-certificate-signed-by-unknown-authority-error/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Mon, 20 May 2024 14:01:16 +0000</pubDate>
				<category><![CDATA[Development Tools]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[ZScaler]]></category>
		<guid isPermaLink="false">https://myshittycode.com/?p=2593</guid>

					<description><![CDATA[<p>Problem Your organization enforces zero-trust network access (ex: Zscaler or equivalent). Based on the ZScaler’s documentation, you made a copy of the Zscaler certificate and added it to Git. The Git’s core commands work successfully. However, when using Git LFS to manage large binary files, it failed with the following errors. Solution Instead of explicitly [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2024/05/20/git-lfs-certificate-signed-by-unknown-authority-error/">Git LFS: &#8220;Certificate Signed by Unknown Authority&#8221; Error</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><ul><li><a href="#problem">Problem</a></li><li><a href="#solution">Solution</a></li></ul></nav></div>



<h2 class="wp-block-heading" id="problem">Problem</h2>



<p>Your organization enforces zero-trust network access (ex: Zscaler or equivalent).</p>



<p>Based on the <a href="https://help.zscaler.com/zia/adding-custom-certificate-application-specific-trust-store" data-type="link" data-id="https://help.zscaler.com/zia/adding-custom-certificate-application-specific-trust-store" target="_blank" rel="noopener">ZScaler’s documentation</a>, you made a copy of the Zscaler certificate and added it to Git.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
git config --global http.sslcainfo ~/ca_certs/zscaler.pem
</pre></div>


<p>The Git’s core commands work successfully. However, when using <a href="https://git-lfs.com/" data-type="link" data-id="https://git-lfs.com/" target="_blank" rel="noopener">Git LFS</a> to manage large binary files, it failed with the following errors.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
$ git push
Uploading LFS objects:   0% (0/3), 0 B | 0 B/s, done.                                                                                
LFS: Put &quot;https://github-cloud.s3.amazonaws.com/alambic/media/703534560/85/85/858586aa357aa9e8c78f64d76a5d6a866ff4f06160508ac5af50175b604b0c77?actor_id=6835135&amp;amp;key_id=0&amp;amp;repo_id=779032228&quot;: tls: failed to verify certificate: x509: certificate signed by unknown authority
LFS: Put &quot;https://github-cloud.s3.amazonaws.com/alambic/media/703534560/5c/47/5c4796e25fcb54726bd605f825d3f53c0804164186ee989af5649164d5026a10?actor_id=6835135&amp;amp;key_id=0&amp;amp;repo_id=779032228&quot;: tls: failed to verify certificate: x509: certificate signed by unknown authority
LFS: Put &quot;https://github-cloud.s3.amazonaws.com/alambic/media/703534560/9c/76/9c766b0bf3e91eed522df3c5e508ce33a6c781a4891c8395154149eb60b537e0?actor_id=6835135&amp;amp;key_id=0&amp;amp;repo_id=779032228&quot;: tls: failed to verify certificate: x509: certificate signed by unknown authority
error: failed to push some refs to &#039;github.com:xxxxxxx/my-repo.git&#039; 
</pre></div>


<h2 class="wp-block-heading" id="solution">Solution</h2>



<p>Instead of explicitly pointing to a ZScaler certificate, configure Git to rely on the device’s global trust store, where your security team should have already added the ZScaler certificate.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
git config --global http.sslBackend openssl
git config --global --unset http.sslcainfo
</pre></div>


<p>Now, Git LFS commands will work successfully.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
$ git push
Uploading LFS objects: 100% (3/3), 194 MB | 26 MB/s, done.
Enumerating objects: 1292, done.
Counting objects: 100% (1292/1292), done.
Delta compression using up to 11 threads
Compressing objects: 100% (1280/1280), done.
Writing objects: 100% (1280/1280), 83.42 MiB | 6.93 MiB/s, done.
Total 1280 (delta 751), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (751/751), completed with 6 local objects.
To github.com:xxxxxxx/my-repo.git
4075ed3..ce4a0e7 main -&gt; main
sh-3.2$ git status
On branch main
Your branch is up to date with &#039;origin/main&#039;.

nothing to commit, working tree clean
</pre></div>


<p></p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2024/05/20/git-lfs-certificate-signed-by-unknown-authority-error/">Git LFS: &#8220;Certificate Signed by Unknown Authority&#8221; Error</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2024/05/20/git-lfs-certificate-signed-by-unknown-authority-error/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2593</post-id>	</item>
		<item>
		<title>Git: Querying Tags Without Cloning the Repository</title>
		<link>https://myshittycode.com/2020/10/02/git-querying-tags-without-cloning-the-repository/</link>
					<comments>https://myshittycode.com/2020/10/02/git-querying-tags-without-cloning-the-repository/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Fri, 02 Oct 2020 16:40:37 +0000</pubDate>
				<category><![CDATA[Development Tools]]></category>
		<category><![CDATA[Git]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=1180</guid>

					<description><![CDATA[<p>PROBLEM A typical way to get a list of tags from a repository is to clone it before running git tag:- versionsort.suffix=- ensures 1.0.0-XXXXXX comes after 1.0.0. To retrieve the latest tag:- While it works, it requires us to clone the repository first, and if we want to retrieve tags from multiple repositories, we are [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2020/10/02/git-querying-tags-without-cloning-the-repository/">Git: Querying Tags Without Cloning the Repository</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>A typical way to get a list of tags from a repository is to clone it before running <b>git tag</b>:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
git clone git@ssh.dev.azure.com:v3/test/my-shitty-repo
cd my-shitty-repo
git -c &#039;versionsort.suffix=-&#039; tag --sort=&#039;v:refname&#039;

# output
1.0.0-b20200317174203
1.0.0
1.0.1-b20200318174753
1.0.1-b20200318174841
1.0.1-b20200407185909
1.0.1
1.0.2-b20200413205910
1.0.2
</pre></div>


<p><b>versionsort.suffix=-</b> ensures <b>1.0.0-XXXXXX</b> comes after <b>1.0.0</b>.</p>



<p>To retrieve the latest tag:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; highlight: [3,4]; title: ; notranslate">
git clone git@ssh.dev.azure.com:v3/test/my-shitty-repo
cd my-shitty-repo
git -c &#039;versionsort.suffix=-&#039; tag --sort=&#039;v:refname&#039; |
tail -n1

# output
1.0.2
</pre></div>


<p>While it works, it requires us to clone the repository first, and if we want to retrieve tags from multiple repositories, we are quickly filling our hard drive space.</p>



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



<p>Git has a way to perform a remote query through <b>git ls-remote</b>.</p>



<p>To perform the same task without cloning the repository, we can run this:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
git -c &#039;versionsort.suffix=-&#039; ls-remote \
--tags \
--sort=&#039;v:refname&#039; \
git@ssh.dev.azure.com:v3/test/my-shitty-repo

# output
b90df3d12413db22d051db1f7c7286cdd2f00b66	refs/tags/1.0.0-b20200317174203
e355a58829a2d2895ab2d7610fad1ab26dc0c1e7	refs/tags/1.0.0
345153c39a588a6ab2782772ee9dcf9f9123efa9	refs/tags/1.0.1-b20200318174753
efc40f0bd68bb8c7920be7700cab81db0e6bdf83	refs/tags/1.0.1-b20200318174841
efc40f0bd68bb8c7920be7700cab81db0e6bdf83	refs/tags/1.0.1-b20200407185909
c5ed5fe30cba621f40daa542c0613fa2c1c1a47d	refs/tags/1.0.1
7205ada5d8bd4318f82e58e8752ba651211f9d82	refs/tags/1.0.2-b20200413205910
6ba62a0f06f831812cbb13a6d1e83602ffe9e8d3	refs/tags/1.0.2
</pre></div>


<p>To retrieve the latest tag:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; highlight: [4,5,6]; title: ; notranslate">
git -c &#039;versionsort.suffix=-&#039; ls-remote \
--tags \
--sort=&#039;v:refname&#039; \
git@ssh.dev.azure.com:v3/test/my-shitty-repo |
tail -n1 |
sed -E &#039;s|.*refs/tags/(.+)|\1|&#039;

# output
1.0.2
</pre></div><p>The post <a rel="nofollow" href="https://myshittycode.com/2020/10/02/git-querying-tags-without-cloning-the-repository/">Git: Querying Tags Without Cloning the Repository</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2020/10/02/git-querying-tags-without-cloning-the-repository/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1180</post-id>	</item>
		<item>
		<title>Git: Configuring Different Git User Info Depending on Projects</title>
		<link>https://myshittycode.com/2019/12/18/git-configuring-different-git-user-info-depending-on-projects/</link>
					<comments>https://myshittycode.com/2019/12/18/git-configuring-different-git-user-info-depending-on-projects/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Wed, 18 Dec 2019 09:29:42 +0000</pubDate>
				<category><![CDATA[Development Tools]]></category>
		<category><![CDATA[Git]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=1120</guid>

					<description><![CDATA[<p>PROBLEM Given, the following global config stored under ~/.gitconfig&#8230; When committing any code, the above user info will always be used. However, there are times you want to use a different user info depending on projects (ex: work projects, GitHub projects, etc) SOLUTION This is one of many ways to solve this problem. Let&#8217;s assume [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2019/12/18/git-configuring-different-git-user-info-depending-on-projects/">Git: Configuring Different Git User Info Depending on Projects</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>Given, the following global config stored under <b>~/.gitconfig</b>&#8230;</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&#x5B;user]
    name = Shitty Developer
    email = shittydeveloper@work.com
</pre></div>


<p>When committing any code, the above user info will always be used.</p>



<p>However, there are times you want to use a different user info depending on projects (ex: work projects, GitHub projects, etc)</p>



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



<p>This is one of many ways to solve this problem.</p>



<p>Let&#8217;s assume <b>shittydeveloper@work.com</b> configured in <b>~/.gitconfig</b> is reserved for work-related projects.</p>



<p>To set up a different user email for GitHub projects, modify <b>~/.gitconfig</b> with the following configuration:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; highlight: [5,6]; title: ; notranslate">
&#x5B;user]
    name = Shitty Developer
    email = shittydeveloper@work.com

&#x5B;includeIf &quot;gitdir:~/github/&quot;]
    path = ~/github/.gitconfig
</pre></div>


<p>Under <b>~/github/.gitconfig</b>, add your GitHub user account&#8217;s email:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&#x5B;user]
    email = shittydeveloper@personal.com
</pre></div>


<p>If the checked out project resides under <b>~/github/</b> directory, any committed code will now use <b>shittydeveloper@personal.com</b> instead of <b>shittydeveloper@work.com</b>.</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2019/12/18/git-configuring-different-git-user-info-depending-on-projects/">Git: Configuring Different Git User Info Depending on Projects</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2019/12/18/git-configuring-different-git-user-info-depending-on-projects/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1120</post-id>	</item>
		<item>
		<title>Git + Linux: (gnome-ssh-askpass:24871): Gtk-WARNING **: cannot open display:</title>
		<link>https://myshittycode.com/2016/09/12/git-linux-gnome-ssh-askpass24871-gtk-warning-cannot-open-display/</link>
					<comments>https://myshittycode.com/2016/09/12/git-linux-gnome-ssh-askpass24871-gtk-warning-cannot-open-display/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Mon, 12 Sep 2016 16:11:10 +0000</pubDate>
				<category><![CDATA[Development Tools]]></category>
		<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=913</guid>

					<description><![CDATA[<p>PROBLEM When running git clone on Linux, the following error appears:- SOLUTION To fix this, run the following command to disable gnome-ssh-askpass:- Now, git clone will work just fine:- To prevent this from happening again, add unset SSH_ASKPASS command to .bashrc file.</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2016/09/12/git-linux-gnome-ssh-askpass24871-gtk-warning-cannot-open-display/">Git + Linux: (gnome-ssh-askpass:24871): Gtk-WARNING **: cannot open display:</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 running <b>git clone</b> on Linux, the following error appears:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
-bash-4.1$ git clone http://user@tfs:8080/tfs/my-institution/my-domain/_git/my-project
Initialized empty Git repository in /people/my-group/user/my-project/.git/

(gnome-ssh-askpass:24871): Gtk-WARNING **: cannot open display:
</pre></div>


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



<p>To fix this, run the following command to disable gnome-ssh-askpass:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
-bash-4.1$ unset SSH_ASKPASS
</pre></div>


<p>Now, <b>git clone</b> will work just fine:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
-bash-4.1$ git clone http://user@tfs:8080/tfs/my-institution/my-domain/_git/my-project
Initialized empty Git repository in /people/my-group/user/my-project/.git/
Password:
remote:
remote:                    fTfs
remote:                  fSSSSSSSs
remote:                fSSSSSSSSSS
remote: TSSf         fSSSSSSSSSSSS
remote: SSSSSF     fSSSSSSST SSSSS
remote: SSfSSSSSsfSSSSSSSt   SSSSS
remote: SS  tSSSSSSSSSs      SSSSS
remote: SS   fSSSSSSST       SSSSS
remote: SS fSSSSSFSSSSSSf    SSSSS
remote: SSSSSST    FSSSSSSFt SSSSS
remote: SSSSt        FSSSSSSSSSSSS
remote:                FSSSSSSSSSS
remote:                  FSSSSSSs
remote:                    FSFs    (TM)
remote:
remote:  Microsoft (R) Visual Studio (R) Team Foundation Server
remote:
Receiving objects: 100% (504/504), 1.05 MiB, done.
Resolving deltas: 100% (138/138), done.
</pre></div>


<p>To prevent this from happening again, add <b>unset SSH_ASKPASS</b> command to <b>.bashrc</b> file.</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2016/09/12/git-linux-gnome-ssh-askpass24871-gtk-warning-cannot-open-display/">Git + Linux: (gnome-ssh-askpass:24871): Gtk-WARNING **: cannot open display:</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2016/09/12/git-linux-gnome-ssh-askpass24871-gtk-warning-cannot-open-display/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">913</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 (Request-wide modification query)

Served from: myshittycode.com @ 2026-02-17 21:09:38 by W3 Total Cache
-->