<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Git on Dark Kernel</title>
    <link>https://blogs.sumit.engineer/tags/git/</link>
    <description>Recent content in Git on Dark Kernel</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 08 Nov 2024 00:00:00 +0000</lastBuildDate>
    
	<atom:link href="https://blogs.sumit.engineer/tags/git/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Easy dotfiles management</title>
      <link>https://blogs.sumit.engineer/notes/2-notes/2024-11-08-easy-dotfiles-management/</link>
      <pubDate>Fri, 08 Nov 2024 00:00:00 +0000</pubDate>
      
      <guid>https://blogs.sumit.engineer/notes/2-notes/2024-11-08-easy-dotfiles-management/</guid>
      <description>&lt;h3 id=&#34;the-easiest-way-to-version-control-your-dotfiles&#34;&gt;The easiest way to version control your dotfiles.&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Initialize empty repo at home&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git init --bare $HOME/.dotfiles
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;[&amp;ndash;more&amp;ndash;]
2. Use working directory of git as &lt;code&gt;$HOME&lt;/code&gt;, and git dir as &lt;code&gt;.dotfiles&lt;/code&gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;alias config=&amp;#39;/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;ol start=&#34;3&#34;&gt;
&lt;li&gt;Only for current local repo, because it&amp;rsquo;s annoying.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;config config status.showUntrackedFiles no
&lt;/code&gt;&lt;/pre&gt;&lt;ol start=&#34;4&#34;&gt;
&lt;li&gt;Here you go, check status, add your configs, and commit.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;config status
config add .config/mpv
config commit -m &amp;#34;Added mpv config&amp;#34;
&lt;/code&gt;&lt;/pre&gt;&lt;ol start=&#34;5&#34;&gt;
&lt;li&gt;Create repo at github/gitlab and add origin -&amp;gt; Push.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;config remote add origin &amp;lt;link&amp;gt;
config push origin master
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;here-you-can-use-different-branches-for-different-computers-you-can-replicate-you-configuration-easily-on-new-installation--&#34;&gt;Here you can use different branches for different computers, you can replicate you configuration easily on new installation -&lt;/h3&gt;
&lt;p&gt;For using dotfiles on other device&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Clone repo into home, if its &lt;strong&gt;empty&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git clone --separate-git-dir=~/.myconf &amp;lt;link-to-repo&amp;gt; ~
&lt;/code&gt;&lt;/pre&gt;&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;Or clone into separate tmp dir, otherwise it &lt;strong&gt;will fail if your home directory isn&amp;rsquo;t empty&lt;/strong&gt;. Then copy your configs and remove tmp dir.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git clone --separate-git-dir=$HOME/.dotfiles &amp;lt;link-to-repo&amp;gt; $HOME/dotfiles-tmp
cp ~/dotfiles-tmp/.vimrc ~
rm -r ~/myconf-tmp/
&lt;/code&gt;&lt;/pre&gt;&lt;ol start=&#34;3&#34;&gt;
&lt;li&gt;Again set alias to manage dotfiles.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;alias config=&amp;#39;/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Done!
easy peezy lemon squeezy :)&lt;/p&gt;
&lt;p&gt;Reference: &lt;a href=&#34;https://wiki.archlinux.org/title/Dotfiles&#34;&gt;ArchWiki&lt;/a&gt; | &lt;a href=&#34;https://news.ycombinator.com/item?id=11071754&#34;&gt;Ycombinator&lt;/a&gt;&lt;/p&gt;
</description> 
    </item>
    
    <item>
      <title>Add new change in previous commit</title>
      <link>https://blogs.sumit.engineer/notes/2-notes/2024-07-29-add-new-change-in-previous-commit/</link>
      <pubDate>Mon, 29 Jul 2024 00:00:00 +0000</pubDate>
      
      <guid>https://blogs.sumit.engineer/notes/2-notes/2024-07-29-add-new-change-in-previous-commit/</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Find the commit hash you want to edit&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git log 
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;[&amp;ndash;more&amp;ndash;]&lt;/p&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;
&lt;p&gt;Start interactive rebase, adjust the number if needed
&lt;code&gt;git rebase -i HEAD~1&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the editor, change &amp;lsquo;pick&amp;rsquo; to &amp;rsquo;edit&amp;rsquo; for the commit you want to modify&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Save and close the editor&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the new file&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git add path/to/newfile 
&lt;/code&gt;&lt;/pre&gt;&lt;ol start=&#34;6&#34;&gt;
&lt;li&gt;Amend the commit to include the new file
&lt;code&gt;git commit --amend&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Save and close the commit message editor&lt;/p&gt;
&lt;ol start=&#34;7&#34;&gt;
&lt;li&gt;
&lt;p&gt;Continue the rebase
&lt;code&gt;git rebase --continue&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Resolve any conflicts if necessary
Force push to the remote repository if needed
&lt;code&gt;git push --force &lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
</description> 
    </item>
    
    <item>
      <title>Git concepts</title>
      <link>https://blogs.sumit.engineer/post/git/</link>
      <pubDate>Sun, 13 Aug 2023 00:00:00 +0000</pubDate>
      
      <guid>https://blogs.sumit.engineer/post/git/</guid>
      <description>&lt;h1 id=&#34;git&#34;&gt;Git&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Branching strategies&lt;/li&gt;
&lt;li&gt;Vcs reset / revert&lt;/li&gt;
&lt;li&gt;PR merge / branch merge&lt;/li&gt;
&lt;li&gt;Merge vs rebase&lt;/li&gt;
&lt;li&gt;Cherry pick&lt;/li&gt;
&lt;li&gt;git stash&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Never commit directly in master branch.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&#34;important-branches&#34;&gt;Important branches:&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;master: The main stable branch.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;staging: For QA team, can be sent for production. Most of the time it is same as master.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;develop: From where developers get codes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;feature: To add any feature.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If passed =&amp;gt; develop ↓&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If passed =&amp;gt; staging ↓&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If passed =&amp;gt; master.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;branching-strategies&#34;&gt;Branching Strategies:&lt;/h3&gt;
&lt;h4 id=&#34;small-team-strategy&#34;&gt;Small team strategy&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Use all important branches&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create features from develop/dev branch.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;develop ↴&lt;/p&gt;
&lt;p&gt;→ feature1&lt;/p&gt;
&lt;p&gt;→ feature2&lt;/p&gt;
&lt;p&gt;→ feature3 &amp;hellip;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use hot fixes whenever needed, like for small bugs, can be done by team lead.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;hotfix: Fixing small bugs, like correction of spelling, no devs needed directly team lead can change it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&#34;big-team-strategy&#34;&gt;Big team strategy&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;There is change in branch name conventions like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;master -&amp;gt; prd&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;staging -&amp;gt; stg&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;develop -&amp;gt; dev&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use JIRA like software, to manage projects. Tasks are assigned as tickets and then status is changed according to progress.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Integrate JIRA with github&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Jira is Issue &amp;amp; project tracking system, which is used by many large scale companies.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&#34;heading&#34;&gt; &lt;/h2&gt;
&lt;h3 id=&#34;git-revert--reset&#34;&gt;Git Revert &amp;amp; Reset&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;h5 id=&#34;git-revert&#34;&gt;git revert:&lt;/h5&gt;
&lt;p&gt;Used to revert/undo a particular commit, It creates new commit of revert, and keeps original commit history.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Get commit id&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git log --oneline
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Revert&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git revert &amp;lt;commit-id&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;
&lt;hr&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;h5 id=&#34;git-reset&#34;&gt;Git Reset:&lt;/h5&gt;
&lt;p&gt;It is used to undo to a particular commit but, it removes all commits history after that commit. Mostly used in case like commited security credentials and want to remove it completely from commit history.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If we have following log:
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;❯ git log --oneline
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;9210da8 &lt;span style=&#34;color:#f92672&#34;&gt;(&lt;/span&gt;HEAD -&amp;gt; dev&lt;span style=&#34;color:#f92672&#34;&gt;)&lt;/span&gt; added git ignore
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;e803737 no keys now
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;de7aa15 Revert &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;added line 2&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;99c25e5 added line &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;25d7961 &lt;span style=&#34;color:#f92672&#34;&gt;(&lt;/span&gt;master&lt;span style=&#34;color:#f92672&#34;&gt;)&lt;/span&gt; initial commit
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;We want to reset &lt;code&gt;de7aa15&lt;/code&gt;, so we will have to use commitid of previous/below commit.
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git reset 99c25e5
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;So after &lt;code&gt;99c25e5&lt;/code&gt; all commits will be deleted.&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- raw HTML omitted --&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Don&amp;rsquo;t use &lt;code&gt;git add .&lt;/code&gt;, some times it might track files which is confidential and can lead to risk.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt; &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&#34;git-merge&#34;&gt;Git Merge&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;h5 id=&#34;branch-merge&#34;&gt;Branch Merge:&lt;/h5&gt;
&lt;p&gt;Git merge is used for merging two branches.&lt;/p&gt;
&lt;p&gt;Example,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You have added some features in dev branch.&lt;/li&gt;
&lt;li&gt;It is passed by QA.&lt;/li&gt;
&lt;li&gt;Now to add that feature to release, you need to merge that feature in main/master/production branch.
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# first switch to branch in which you want to merge.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git checkout master
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Then merge&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git merge dev
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;There is something called &lt;code&gt;squash&lt;/code&gt; which is used to merge without commit history.
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git merge dev --squash
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&#34;git-rebase&#34;&gt;Git rebase&lt;/h3&gt;
&lt;p&gt;It Adds commit history of other branch/remote in linear/sequence way while merging.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Difference:&lt;/strong&gt;&lt;/p&gt;
&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Merge&lt;/th&gt;
          &lt;th&gt;Rebase&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Only HEAD commit is maintained while merging&lt;/td&gt;
          &lt;td&gt;Full commit history is maintained while merging in sequence&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;While pulling we can use rebase, to reconcile divergent branch.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git pull origin master --rebase
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Rebase a particular branch.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git rebase master
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt; &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&#34;cherry-pick&#34;&gt;Cherry pick&lt;/h3&gt;
&lt;p&gt;Pick a particular commit from any branch and apply to master or any other branch.
In simple words apply that particular commit to current branch.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git cherry-pick &amp;lt;commit-id&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt; &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&#34;git-stash&#34;&gt;Git stash&lt;/h3&gt;
&lt;p&gt;Using this your current work is stored somewhere, not commited but tracked by git which can be loaded anytime. This is something where you can store your partial changes and commit later on.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Stash&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git stash
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Apply stash to working dir&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git stash pop
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;List stashs&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git stash list
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Apply a particular stash&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git stash apply stash@&amp;lt;list-number&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;So, that&amp;rsquo;s it.&lt;/p&gt;
</description> 
    </item>
    
  </channel>
</rss>


