<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Git on Tutes Club</title><link>https://tutes.in/tag/git/</link><description>Recent content in Git on Tutes Club</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 25 Apr 2022 13:29:10 +0000</lastBuildDate><atom:link href="https://tutes.in/tag/git/index.xml" rel="self" type="application/rss+xml"/><item><title>How to generate a patch with edited files? How to zip latest committed changes only</title><link>https://tutes.in/how-to-generate-a-patch-with-edited-files-how-to-zip-latest-committed-changes-only/</link><pubDate>Mon, 06 Sep 2021 11:34:34 +0000</pubDate><guid>https://tutes.in/how-to-generate-a-patch-with-edited-files-how-to-zip-latest-committed-changes-only/</guid><description>&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;zip archive.zip $(git diff-tree --no-commit-id --name-only -r latest-commit-id)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;: &lt;a href="https://stackoverflow.com/a/42971972/2229148"&gt;https://stackoverflow.com/a/42971972/2229148&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;sometimes you need all the files that were updated so you can patch an external app which doesnt uses same git project or many other scenarios in which we need a zip or tar of those files. Use the above command to do so&lt;/p&gt;
&lt;p&gt;There is a &lt;strong&gt;smarter way&lt;/strong&gt; also, if you want all the changes from last 5 commits, use the command like this:&lt;/p&gt;</description></item><item><title>How to remove files with “No Content Changes Found” in Git Desktop</title><link>https://tutes.in/how-to-remove-files-with-no-content-changes-found-in-git-desktop/</link><pubDate>Wed, 08 May 2019 10:02:59 +0000</pubDate><guid>https://tutes.in/how-to-remove-files-with-no-content-changes-found-in-git-desktop/</guid><description>&lt;p&gt;There are 3 possible ways git can find a file changed (even if you didn’t change it)&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Line Endings have changed&lt;/li&gt;
&lt;li&gt;File permissions have changed&lt;/li&gt;
&lt;li&gt;Bonus: if modification time has changed&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;for first case try these settings in bash shell. &lt;strong&gt;One of these&lt;/strong&gt; will fix it for you&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ git config core.eol
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ git config core.autocrlf
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ git config core.safecrlf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For second case, here is the flag&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git config core.filemode &lt;span class="nb"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="bonus-one-if-modification-time-was-changed"&gt;Bonus One: If Modification time was changed&lt;/h3&gt;
&lt;p&gt;If your working tree has files with updated “last modification time” and you see a huge list of files with “no content changes found”, try this:&lt;/p&gt;</description></item><item><title>How to push into master or any other branch after removing last n commits in git?</title><link>https://tutes.in/how-to-push-into-master-after-removing-last-two-commits-in-git/</link><pubDate>Mon, 21 Jan 2019 19:23:45 +0000</pubDate><guid>https://tutes.in/how-to-push-into-master-after-removing-last-two-commits-in-git/</guid><description>&lt;ol&gt;
&lt;li&gt;&lt;code&gt;git log&lt;/code&gt; to find out the commit you want to revert&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git push origin +daee17:master&lt;/code&gt; while daee17 is the commit before the wrongly pushed commit.&lt;code&gt;+&lt;/code&gt; was for &lt;code&gt;force push&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Finally use &lt;code&gt;git push origin master&lt;/code&gt; to sync your local with your git repo&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;And that’s it.&lt;/p&gt;
&lt;p&gt;Below is my log aka example. One of the teammates had committed to the repo (he was not supposed to) after which I committed on server and when I tried to push it on github.com, I received REJECTED error because the remote contained 2 commits which the server did not have.&lt;/p&gt;</description></item><item><title>How to learn Git in 15 minutes? List of most basic git commands</title><link>https://tutes.in/important-useful-git-commands/</link><pubDate>Wed, 02 Jan 2019 04:55:22 +0000</pubDate><guid>https://tutes.in/important-useful-git-commands/</guid><description>These most important Git commands are surely going to help you. Learn basics of git in a few minutes of reading</description></item></channel></rss>