<?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>Autarchy of the Private Cave &#187; history</title> <atom:link href="https://bogdan.org.ua/tags/history/feed" rel="self" type="application/rss+xml" /><link>https://bogdan.org.ua</link> <description>Tiny bits of bioinformatics, [web-]programming etc</description> <lastBuildDate>Wed, 28 Dec 2022 16:09:04 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>https://wordpress.org/?v=3.8.27</generator> <item><title>How to truncate git history (sample script included)</title><link>https://bogdan.org.ua/2011/03/28/how-to-truncate-git-history-sample-script-included.html</link> <comments>https://bogdan.org.ua/2011/03/28/how-to-truncate-git-history-sample-script-included.html#comments</comments> <pubDate>Mon, 28 Mar 2011 18:17:21 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[how-to]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[git]]></category> <category><![CDATA[history]]></category> <category><![CDATA[truncate]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=1481</guid> <description><![CDATA[Under a few assumptions (most importantly &#8211; you do not have any non-merged branches,), it is very easy to throw away git repository commits older than an arbitrarily-chosen commit. Here&#8217;s a sample script (call it e.g. git-truncate and put into your ~/bin or whichever location you have in PATH). #!/bin/bash git checkout --orphan temp $1 [&#8230;]]]></description> <content:encoded><![CDATA[<p>Under a few assumptions (most importantly &#8211; you do not have any non-merged branches,), it is very easy to throw away git repository commits older than an arbitrarily-chosen commit.</p><p>Here&#8217;s a sample script (call it e.g. <strong>git-truncate</strong> and put into your ~/bin or whichever location you have in PATH).</p><p><code><br
/> #!/bin/bash<br
/> git checkout --orphan temp $1<br
/> git commit -m "Truncated history"<br
/> git rebase --onto temp $1 master<br
/> git branch -D temp<br
/> # The following 2 commands are optional - they keep your git repo in good shape.<br
/> git prune --progress # delete all the objects w/o references<br
/> git gc --aggressive # aggressively collect garbage; may take a lot of time on large repos<br
/> </code></p><p>Invocation: cd to your repository, then <strong>git-truncate <em>refspec</em></strong>, where <em>refspec</em> is either a commit&#8217;s SHA1 hash-id, or a tag.</p><p>Expected result: a git repository starting with &#8220;Truncated history&#8221; initial commit, and continuing to the tip of the branch you were on when calling the script.</p><p>If you truncate repositories often, then consider adding an optional 2nd argument (truncate-commit message) and also some safeguards against improper use &#8211; currently, even if refspec is wrong, the script will <strong>not</strong> abort after a failed checkout.</p><p>Thanks for posting any improvements you may have.</p><p>Source: <a
href="http://support.github.com/discussions/repos/5751-how-to-truncate-the-history-of-a-repository" class="broken_link" rel="nofollow">Tekkub&#8217;s post on github discussions</a>.<br
/> See also: <a
href="http://bogdan.org.ua/2009/02/13/git-how-to-remove-file-commit-from-history.html">how to remove a single file from all of git&#8217;s commits</a>.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F03%2F28%2Fhow-to-truncate-git-history-sample-script-included.html&amp;linkname=How%20to%20truncate%20git%20history%20%28sample%20script%20included%29" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F03%2F28%2Fhow-to-truncate-git-history-sample-script-included.html&amp;linkname=How%20to%20truncate%20git%20history%20%28sample%20script%20included%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F03%2F28%2Fhow-to-truncate-git-history-sample-script-included.html&amp;linkname=How%20to%20truncate%20git%20history%20%28sample%20script%20included%29" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F03%2F28%2Fhow-to-truncate-git-history-sample-script-included.html&amp;linkname=How%20to%20truncate%20git%20history%20%28sample%20script%20included%29" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F03%2F28%2Fhow-to-truncate-git-history-sample-script-included.html&amp;linkname=How%20to%20truncate%20git%20history%20%28sample%20script%20included%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2011%2F03%2F28%2Fhow-to-truncate-git-history-sample-script-included.html&#038;title=How%20to%20truncate%20git%20history%20%28sample%20script%20included%29" data-a2a-url="https://bogdan.org.ua/2011/03/28/how-to-truncate-git-history-sample-script-included.html" data-a2a-title="How to truncate git history (sample script included)"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2011/03/28/how-to-truncate-git-history-sample-script-included.html/feed</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>Git: how to remove file and commit from history</title><link>https://bogdan.org.ua/2009/02/13/git-how-to-remove-file-commit-from-history.html</link> <comments>https://bogdan.org.ua/2009/02/13/git-how-to-remove-file-commit-from-history.html#comments</comments> <pubDate>Fri, 13 Feb 2009 19:21:32 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[how-to]]></category> <category><![CDATA[Links]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[file]]></category> <category><![CDATA[git]]></category> <category><![CDATA[history]]></category> <category><![CDATA[remove]]></category> <category><![CDATA[repository]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=590</guid> <description><![CDATA[Once I accidentally added circa 300 MiB of archive files to one of my git repositories (which was as small as 5 MiB). I removed those files as soon as I noticed them, but the .git directory still preserved commits with those files, and still occupied over 300 MiB. I have found the solution at [&#8230;]]]></description> <content:encoded><![CDATA[<p>Once I accidentally added circa 300 MiB of archive files to one of my git repositories (which was as small as 5 MiB). I removed those files as soon as I noticed them, but the .git directory still preserved commits with those files, and still occupied over 300 MiB.</p><p>I have found the <a
href="http://stackoverflow.com/questions/307828/git-remove-file-accidentally-added-to-the-repository">solution</a> at <a
href="http://stackoverflow.com/">stackoverflow</a> (see also this <a
href="http://stackoverflow.com/questions/250238/collapsing-a-git-repositorys-history">question</a>).</p><p>This method worked for me, but I couldn&#8217;t push my rebased repository to the gitosis. I would need to re-init the gitosis repository from my rebased, but I&#8217;m not yet prepared to do that.</p><p>There is also a slightly different method (which relies on a temporary tag instead of a temporary branch), documented in Git online manual pages; I prefer the temporary branch method.</p><p>Below is a full copy-paste of the winning answer by Charles Bailey:</p><blockquote><p> # create and check out a temporary branch at the location of the bad merge<br
/> git checkout -b tmpfix <sha1-of-bad-merge-or-commit></p><p># remove the incorrectly added file<br
/> git rm somefile.orig</p><p># commit the amended merge<br
/> git commit &#8211;amend</p><p># go back to the master branch<br
/> git checkout master</p><p># replant the master branch onto the corrected merge<br
/> git rebase tmpfix</p><p># delete the temporary branch<br
/> git branch -d tmpfix</p></blockquote><p>Also, in my case <a
href="http://stackoverflow.com/questions/495345/git-removing-selected-commits-from-repository">this thread</a> at stackoverflow was highly useful. I start enjoying the concise and compact style of Charles Bailey <img
src="https://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /> :<br
/> <span
id="more-590"></span></p><blockquote><p> # detach head and move to D commit<br
/> git checkout <SHA1-for-D></p><p># move HEAD to A, but leave the index and working tree as for D<br
/> git reset &#8211;soft <SHA1-for-A></p><p># Redo the D commit re-using the commit message, but now on top of A<br
/> git commit -C <SHA1-for-D></p><p># Re-apply everything from the old D onwards onto this new place<br
/> git rebase &#8211;onto HEAD <SHA1-for-D> master</p></blockquote><p>Note: this example is for a branch of commits R&#8211;A&#8211;B&#8211;C&#8211;D&#8211;E&#8211;HEAD, where commits B &#038; C should be removed from commit history.</p><p>Another option is to use git rebase &#8211;interactive (for the same example):</p><blockquote><p> git rebase -i HEAD~5</p></blockquote><p>Unfortunately, rebasing on a public (pushed out) branch has no effect for other users of the current gitosis repository.</p><p>An alternative to re-initializing gitosis repository from rebased scratch could be switching to a different (rebased) branch, and deleting the outdated master branch; but I haven&#8217;t investigated if this works.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F13%2Fgit-how-to-remove-file-commit-from-history.html&amp;linkname=Git%3A%20how%20to%20remove%20file%20and%20commit%20from%20history" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F13%2Fgit-how-to-remove-file-commit-from-history.html&amp;linkname=Git%3A%20how%20to%20remove%20file%20and%20commit%20from%20history" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F13%2Fgit-how-to-remove-file-commit-from-history.html&amp;linkname=Git%3A%20how%20to%20remove%20file%20and%20commit%20from%20history" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F13%2Fgit-how-to-remove-file-commit-from-history.html&amp;linkname=Git%3A%20how%20to%20remove%20file%20and%20commit%20from%20history" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F13%2Fgit-how-to-remove-file-commit-from-history.html&amp;linkname=Git%3A%20how%20to%20remove%20file%20and%20commit%20from%20history" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F13%2Fgit-how-to-remove-file-commit-from-history.html&#038;title=Git%3A%20how%20to%20remove%20file%20and%20commit%20from%20history" data-a2a-url="https://bogdan.org.ua/2009/02/13/git-how-to-remove-file-commit-from-history.html" data-a2a-title="Git: how to remove file and commit from history"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2009/02/13/git-how-to-remove-file-commit-from-history.html/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Ukrainian web-portal bigmir.net switched from own free email service to gmail</title><link>https://bogdan.org.ua/2007/10/30/ukrainian-web-portal-bigmirnet-switched-from-own-free-email-service-to-gmail.html</link> <comments>https://bogdan.org.ua/2007/10/30/ukrainian-web-portal-bigmirnet-switched-from-own-free-email-service-to-gmail.html#comments</comments> <pubDate>Tue, 30 Oct 2007 19:05:33 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[Misc]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[developer]]></category> <category><![CDATA[development]]></category> <category><![CDATA[free]]></category> <category><![CDATA[google]]></category> <category><![CDATA[history]]></category> <category><![CDATA[import]]></category> <category><![CDATA[important]]></category> <category><![CDATA[personality]]></category> <category><![CDATA[search]]></category> <category><![CDATA[server]]></category> <category><![CDATA[services]]></category> <category><![CDATA[term]]></category> <category><![CDATA[Ukraine]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/2007/10/30/ukrainian-web-portal-bigmirnet-switched-from-own-free-email-service-to-gmail.html</guid> <description><![CDATA[Just a minute ago, I was shocked after logging in to mail.bigmir.net: instead of the bigmir&#8217;s own, HTML-only email interface, I got redirected at the gmail&#8217;s &#8220;Terms and conditions&#8221;, after accepting which I found my emails in the classic gmail mailbox. First thing to think about: at least they did transfer all my emails to [&#8230;]]]></description> <content:encoded><![CDATA[<p>Just a minute ago, I was shocked after logging in to mail.bigmir.net: instead of the bigmir&#8217;s own, HTML-only email interface, I got redirected at the gmail&#8217;s &#8220;Terms and conditions&#8221;, after accepting which I found my emails in the classic gmail mailbox.</p><p>First thing to think about: at least they did transfer all my emails to the new account.</p><p>Second: hey, they had given up their own email interface! Are they leaving the web-portal market of Ukraine? Was the part of their team (which later formed MI6) too important to handle their exodus with no consequences? Is that just a desire to give customers &#8220;better&#8221; interface and not invest anything into development?</p><p>I hope this won&#8217;t be a trend, for every service to have Google behind their servers. Or even just behind the name, to avoid extra complexity of having a server.</p><p>Finally, I think I&#8217;ll get used. But it was only yesterday, that I read the Google anti-utopia, where Big Brother&#8217;s name is (evidently) Google, and it&#8217;s webcams and microphones and search history define each person&#8217;s future AND guilt. Scary&#8230;</p><p>And I wonder which will be the next service of bigmir.net, &#8220;outsourced&#8221; like their email.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F10%2F30%2Fukrainian-web-portal-bigmirnet-switched-from-own-free-email-service-to-gmail.html&amp;linkname=Ukrainian%20web-portal%20bigmir.net%20switched%20from%20own%20free%20email%20service%20to%20gmail" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F10%2F30%2Fukrainian-web-portal-bigmirnet-switched-from-own-free-email-service-to-gmail.html&amp;linkname=Ukrainian%20web-portal%20bigmir.net%20switched%20from%20own%20free%20email%20service%20to%20gmail" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F10%2F30%2Fukrainian-web-portal-bigmirnet-switched-from-own-free-email-service-to-gmail.html&amp;linkname=Ukrainian%20web-portal%20bigmir.net%20switched%20from%20own%20free%20email%20service%20to%20gmail" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F10%2F30%2Fukrainian-web-portal-bigmirnet-switched-from-own-free-email-service-to-gmail.html&amp;linkname=Ukrainian%20web-portal%20bigmir.net%20switched%20from%20own%20free%20email%20service%20to%20gmail" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F10%2F30%2Fukrainian-web-portal-bigmirnet-switched-from-own-free-email-service-to-gmail.html&amp;linkname=Ukrainian%20web-portal%20bigmir.net%20switched%20from%20own%20free%20email%20service%20to%20gmail" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2007%2F10%2F30%2Fukrainian-web-portal-bigmirnet-switched-from-own-free-email-service-to-gmail.html&#038;title=Ukrainian%20web-portal%20bigmir.net%20switched%20from%20own%20free%20email%20service%20to%20gmail" data-a2a-url="https://bogdan.org.ua/2007/10/30/ukrainian-web-portal-bigmirnet-switched-from-own-free-email-service-to-gmail.html" data-a2a-title="Ukrainian web-portal bigmir.net switched from own free email service to gmail"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2007/10/30/ukrainian-web-portal-bigmirnet-switched-from-own-free-email-service-to-gmail.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>