<?xml version="1.0" encoding="utf-8"?> 
<rss version="2.0"
  xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
  xmlns:atom="http://www.w3.org/2005/Atom">

<channel>

<title>Discover Docker, K8s and Hashicorp Nomad with Maksym Prokopov: posts tagged github</title>
<link>https://blog.it-premium.com.ua/tags/github/</link>
<description>The blog about containerisation, virtual machines and useful shell snippets and findings</description>
<author></author>
<language>en</language>
<generator>Aegea 11.3 (v4134)</generator>

<itunes:subtitle>The blog about containerisation, virtual machines and useful shell snippets and findings</itunes:subtitle>
<itunes:image href="" />
<itunes:explicit></itunes:explicit>

<item>
<title>How to remove broken LFS assets from git repo.</title>
<guid isPermaLink="false">204</guid>
<link>https://blog.it-premium.com.ua/all/how-to-remove-broken-lfs-assets-from-git-repo/</link>
<pubDate>Fri, 01 Feb 2019 09:02:36 +0100</pubDate>
<author></author>
<comments>https://blog.it-premium.com.ua/all/how-to-remove-broken-lfs-assets-from-git-repo/</comments>
<description>
&lt;p&gt;Sometimes you can get error similar to this&lt;br /&gt;
Object does not exist on the server: [404] Object does not exist on the server&lt;/p&gt;
&lt;p&gt;That means you messed with upload of your artifacts to LFS and they changed at some point and being commited to repo.&lt;br /&gt;
The only way to fix that is to remove these files from commit, that will overwrite your history, hense you have to push your branch with --force flag to overwrite your remote repository.&lt;/p&gt;
&lt;p&gt;So here is your hard way to fix that:&lt;/p&gt;
&lt;ol start="1"&gt;
&lt;li&gt;Search for the commit that contains your assets. In my case it is Runtime/platforms/hpux/hpux_rebuilt.tar&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;git log --raw --all --full-history -- Runtime/platforms/hpux/hpux_rebuilt.tar&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;
tree 901cb036d4dfef5c36c66d6452b3d496d0e22772
parent 19848337754164ea17afcd1eb7bd55ef512b3c34
author Maksym Prokopov &lt;mprokopov@gmail.com&gt; 1548405977 +0700
committer Maksym Prokopov &lt;mprokopov@gmail.com&gt; 1548405977 +0700

added script clause
&lt;/pre&gt;
&lt;p&gt;search your file with&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;git cat-file -p 901cb and drill down until you find your assed blob sha1&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;
100644 blob 496ee2ca6a2f08396a4076fe43dedf3dc0da8b6d.gitignore
040000 tree 1c93b94f6ec752528a46741a7ff94e81d46afdcfAppServer
040000 tree b32efb40aa560188970fc4f470c697e06f7c7030Build
100644 blob 050d454e84afc229f35144ef8f13087c58d11f8aJenkinsfile_AppServer_Cobol
040000 tree ceac52278585b596885410e38021bbcbb95cd7b6Runtime
&lt;/pre&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;git cat-file -p ceac52&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;040000 tree ff05d245ea0782b43355affc5fe8237ec8619bdcplatforms&lt;/pre&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;git cat-file -p ff05d245ea0782&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;
040000 tree c9c55c219bc5cf5436cdb4d4dcf761a088677bc2aix
040000 tree 65cc3c3899d9bfecbf95999fdaed24c2235fc887hpux
040000 tree 13bada715fbde55b9d1e3be0aa0c82a8ed886ca0intel_nt
040000 tree ad1b0ec603f2895a91a3241fa3ad034c97645b44solaris
&lt;/pre&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;git cat-file -p 65cc3c3899d9bfecbf95999fda&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;
040000 tree 3477a0392bd9733297c52284a85776bf2461f7d8SDK
100644 blob ae6c4b1828104c732c36a680c5b298fb5769fbafcshp1_list
040000 tree 1bfe688c02bbf87836d70709318d750b89f17f6aexec
100644 blob 808487ec8d13531604c58a632dec9373c2629647executables_list
100644 blob f2033d65e09b598f6a19e141cae59c980f8595aehpux_rebuilt.tar
100644 blob 82cf5d66ffdecde3f059f9bc9914f1fc8498b5f0non_executables_list
040000 tree 182465cb595fa768df9376f558110eff8cc88afcsbin
&lt;/pre&gt;
&lt;p&gt;here is your blob id&lt;/p&gt;
&lt;pre&gt;100644 blob f2033d65e09b598f6a19e141cae59c980f8595aehpux_rebuilt.tar&lt;/pre&gt;
&lt;ol start="2"&gt;
&lt;li&gt;Find assets blog_id. Put their blob_id to some file.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Put f2033d65e09b598f6a19e141cae59c980f8595ae to blob-ids file&lt;/p&gt;
&lt;p&gt;Repeate step 1 for every file your’re missing.&lt;/p&gt;
&lt;ol start="3"&gt;
&lt;li&gt;Download and execute (&lt;a href="https://rtyley.github.io/bfg-repo-cleaner/"&gt;https://rtyley.github.io/bfg-repo-cleaner/&lt;/a&gt; BFG utility) with flag -bi and your file with blob ids.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;java -jar ~/Downloads/bfg-1.13.0.jar -bi blob-ids&lt;/code&gt;&lt;/pre&gt;&lt;ol start="4"&gt;
&lt;li&gt;Revert last commit and remove files.&lt;br /&gt;
You’ll see&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;
Updating references:    100% (10/10)
...Ref update completed in 15 ms.

Commit Tree-Dirt History
------------------------

Earliest                                              Latest
|                                                          |
DmDmDDmDmDmmDmDmDDDmmDmDmDmDDDmDmDmmDmDmDDDmDmDmDmDDmDDmmmDm

D = dirty commits (file tree fixed)
m = modified commits (commit message or parents changed)
. = clean commits (no changes to file tree)

                        Before     After
-------------------------------------------
First modified commit | 39384790 | 5c5a7a09
Last dirty commit     | 71d09db3 | 495a1329

Deleted files
-------------

Filename                  Git id
------------------------------------------
15schemas.tar           | b795d231 (134 B)
ciar_vb4_15.tar         | 2d06bbb5 (133 B)
ciar_xsl_15.tar         | 26c79c30 (132 B)
civt_vb4_15.tar         | 23d54549 (132 B)
civt_xsl_15.tar         | 7201bc36 (131 B)
mysql.tar               | e3d9d62d (131 B)
wrunora.15.1.0.0_11.2.0 | d752af96 (133 B)

&lt;/pre&gt;
&lt;p&gt;In total, 109 object ids were changed. Full details are logged here:&lt;/p&gt;
&lt;ol start="5"&gt;
&lt;li&gt;Redo commit.&lt;/li&gt;
&lt;li&gt;Execute git garbage collection.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;git reflog expire --expire=now --all &amp;amp;&amp;amp; git gc --prune=now --aggressive&lt;/code&gt;&lt;/pre&gt;&lt;ol start="7"&gt;
&lt;li&gt;Push your changes with --force to remote repo.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;git push origin --force&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you want to re-add LFS files&lt;br /&gt;
you can do it with&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;git lfs track &amp;quot;filename&amp;quot;&lt;/code&gt;&lt;/pre&gt;</description>
</item>

<item>
<title>Бесплатный хостинг для сайта на github</title>
<guid isPermaLink="false">25</guid>
<link>https://blog.it-premium.com.ua/all/besplatny-hosting-dlya-sayta-na-github/</link>
<pubDate>Fri, 18 Sep 2015 12:08:54 +0100</pubDate>
<author></author>
<comments>https://blog.it-premium.com.ua/all/besplatny-hosting-dlya-sayta-na-github/</comments>
<description>
&lt;p&gt;Для примера &lt;a href="http://tonskiy.me"&gt;http://tonskiy.me&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/tonsky/tonsky.github.io"&gt;https://github.com/tonsky/tonsky.github.io&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://tonsky.me"&gt;http://tonsky.me&lt;/a&gt;&lt;/p&gt;
</description>
</item>


</channel>
</rss>