<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Luka on Medium]]></title>
        <description><![CDATA[Stories by Luka on Medium]]></description>
        <link>https://medium.com/@lukabaramishvili?source=rss-42770fa81a65------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*hs0Wo0WfG2QMLAQRKhdJlQ.png</url>
            <title>Stories by Luka on Medium</title>
            <link>https://medium.com/@lukabaramishvili?source=rss-42770fa81a65------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 12:26:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lukabaramishvili/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Group Anagrams]]></title>
            <link>https://lukabaramishvili.medium.com/group-anagrams-9afa6d1718d3?source=rss-42770fa81a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/9afa6d1718d3</guid>
            <category><![CDATA[anagram]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[leetcode]]></category>
            <dc:creator><![CDATA[Luka]]></dc:creator>
            <pubDate>Sat, 04 Apr 2020 09:00:22 GMT</pubDate>
            <atom:updated>2020-04-07T05:25:50.812Z</atom:updated>
            <content:encoded><![CDATA[<h4>Algorithm Challenge in JS</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UEMw0AZng2-v3rtT.jpg" /><figcaption>source: <a href="http://canvas.pantone.com/gallery/26110029/Anagram">http://canvas.pantone.com/gallery/26110029/Anagram</a></figcaption></figure><p>Today I will talk about a very interesting question and concept that often comes up on technical interviews. It’s been reported that Amazon, Microsoft, Facebook, and many other companies ask Anagram questions on interviews.</p><p>I will try to explain the solution using Javascript. However, before we dive into problem-solving, let’s explain what Anagram is.</p><p>By definition, “an anagram is a word or phrase that is made by rearranging the letters of another word or phrase.” In other words, taking one word or phrase and changing the order of its characters to produce a new word or phrase. For example: study = dusty, cat= act. If you are a Harry Potter fan, you will remember that Lord Voldemort’s actual name is an anagram of his birth name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*TO7DB8hwQop7vSlU.jpg" /></figure><p>The question I am going to use is from Leetcode:</p><p>Given an array of strings, group anagrams together.</p><p><strong>Example:</strong></p><pre><strong>Input:</strong> [&quot;eat&quot;, &quot;tea&quot;, &quot;tan&quot;, &quot;ate&quot;, &quot;nat&quot;, &quot;bat&quot;],<br><strong>Output:</strong><br>[<br>  [&quot;ate&quot;,&quot;eat&quot;,&quot;tea&quot;],<br>  [&quot;nat&quot;,&quot;tan&quot;],<br>  [&quot;bat&quot;]<br>]</pre><p><strong>Note:</strong></p><ul><li>All inputs will be in lowercase.</li><li>The order of your output does not matter.</li></ul><p>It’s important to note: <br>1. Anagram words share the same characters;<br>2. Anagram words share the same amount of characters;</p><p>These two concepts help us to think about grouping and how is it possible to compare the same characters of words/phrase that has the same length.</p><p>One way of solving this problem is to take every string from the array, “split” them by characters (‘eat’ = ‘e’, ‘a’, ‘t’), sort alphabetically, join back, and compare them with another words’ set of characters. <br>However, the next challenge is to appropriately place or categorize word that has anagrams. For this, we are going to use <strong>Hash </strong>which will help us create strings as keys, and values as arrays of appropriate words/anagrams.</p><p>To visualize it:</p><pre>const hash = {<br> [<br>   &quot;aet&quot;: [&quot;ate&quot;,&quot;eat&quot;,&quot;tea&quot;],<br>   &quot;ant&quot;: [&quot;nat&quot;,&quot;tan&quot;],<br>   &quot;abt&quot;: [&quot;bat&quot;]<br> ]<br>}</pre><p>1 . To start we create empty hash:</p><pre>const hash = {}</pre><p>2. Loop over the array to get each string or word from the array and sort them alphabetically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YN_5RbbGkEPFE9zuYRNA9Q.png" /></figure><p>3. Next let&#39;s start constructing our hash. First we are checking if our hash has key. If it does not have the key, then assign it to our hash with the corresponding strings as values. Otherwise, we push string values inside corresponding keys.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LjIt_4IHOUnxkiH0LgP3qg.png" /></figure><p>4. Finally, our hash is going to look like this:</p><pre>const hash = {<br> [<br>   &quot;aet&quot;: [&quot;ate&quot;,&quot;eat&quot;,&quot;tea&quot;],<br>   &quot;ant&quot;: [&quot;nat&quot;,&quot;tan&quot;],<br>   &quot;abt&quot;: [&quot;bat&quot;]<br> ]<br>}</pre><p>However, we will only need to return <strong>hash values</strong>, which is done like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gqNDVaeYbETzW6QNK1ttNg.png" /></figure><p>and our return is going to be:</p><pre><strong>Output:</strong><br>[<br>  [&quot;ate&quot;,&quot;eat&quot;,&quot;tea&quot;],<br>  [&quot;nat&quot;,&quot;tan&quot;],<br>  [&quot;bat&quot;]<br>]</pre><p>The whole code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A4xvwmkeWuN7kfAMn-cx5A.png" /></figure><p>Resources:</p><ul><li><a href="https://www.geeksforgeeks.org/given-a-sequence-of-words-print-all-anagrams-together/">Given a sequence of words, print all anagrams together | Set 1 - GeeksforGeeks</a></li><li><a href="https://word.tips/anagram-solver/">Anagram Solver</a></li><li><a href="https://stackoverflow.com/questions/909449/anagrams-finder-in-javascript">Anagrams finder in javascript</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9afa6d1718d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[.gitignore File and It’s Usability]]></title>
            <link>https://lukabaramishvili.medium.com/gitignore-file-and-its-usability-518a6d07b764?source=rss-42770fa81a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/518a6d07b764</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[gitignore]]></category>
            <dc:creator><![CDATA[Luka]]></dc:creator>
            <pubDate>Mon, 30 Mar 2020 00:37:33 GMT</pubDate>
            <atom:updated>2020-03-30T00:37:33.508Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*9QGrj0yf4XkHGKNg.png" /></figure><p>As the name indicates, the<strong>.gitignore</strong> file, which is a text file, can be used to let Git know which files and directories to exclude/ignore from our git repositories. In other words, it indicates, which files are not necessary to be tracked (to be committed and pushed). Usually, in every codebase we will have some files that need to be or are recommended to be ignored. Most of the time <strong>.gitignore</strong> file is created in your repository’s root directory but it could be created as a global file in case we want to ignore something globally in every repository on our machines.</p><p>Some of the cases why we don’t want to commit some files in our version control are:</p><ul><li>Mac or Windows system files, such as <strong>.DS_Store. </strong>These files are not really necessary to be on our git repository.</li><li><strong>.gitignore </strong>can be used to hide <strong>API keys and secrets</strong>.</li><li>Ignore <strong>Sass config</strong> files.</li><li>Ignored files also could be <strong>text files (</strong>or .txt). Text files that were created for your notes or reminders.</li><li>Ignore <strong>local development environment configuration files</strong>. These files are specific to every developer. Therefore no need to be included on your repository.</li><li>Ignore <strong>node_module</strong> folder.</li></ul><p><strong>How to create </strong><strong>.gitignore file?</strong></p><ol><li>Open your Terminal</li><li>cd (Navigate) into your local git repository</li><li>Create <strong>.gitignore </strong>file by typing in your Terminal: <br>$ touch .gitignore</li></ol><p>It can also be very common to remove and re-locate already committed file/folder into.gitignore<strong> </strong>file. To explain it well, I will provide steps to remove <strong>node_module</strong> folder as an example:</p><ol><li>Create a .gitignore file in the git repository if it does not contain one</li></ol><p>touch .gitignore</p><p>2. Open up the .gitignore and add the following line to the file</p><p><strong>node_modules</strong></p><p>3. Remove the<strong> node_modules</strong> folder from the git repository:</p><p>git rm -r --cached node_modules</p><p>4. Commit the git repository without the node modules folder:</p><p>git commit -m &quot;Removed node_module folder&quot;</p><p>5. Push the repository to github:</p><p>git push origin master</p><p>6. After all of that, you should also add the .gitignore and commit it to the repository:</p><p>git add .gitignore</p><p>git commit -m &quot;Updated the .gitignore file</p><p>git push origin master</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Finally, as mentioned there is a way to configure ignored files globally for all repositories on your computer:</p><ol><li>Open your Terminal</li><li>Type the following command to configure Git for all repositories in your PC.</li></ol><pre>$ git config --global core.excludesfile ~/.gitignore_global </pre><p>I hope these instructions will be helpful and exclude some files/folders that you think are not necessary to commit in your Git repository.</p><p>More Resouces:</p><ul><li><a href="https://github.com/github/gitignore">GitHub - github/gitignore: A collection of useful .gitignore templates</a></li><li><a href="https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring">Git - Recording Changes to the Repository</a></li><li><a href="https://help.github.com/en/github/using-git/ignoring-files">Ignoring files</a></li><li><a href="https://guide.freecodecamp.org/git/gitignore/">Gitignore</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=518a6d07b764" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Naming Conventi]]></title>
            <link>https://lukabaramishvili.medium.com/naming-conventi-a441893108ba?source=rss-42770fa81a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/a441893108ba</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Luka]]></dc:creator>
            <pubDate>Mon, 23 Mar 2020 03:43:31 GMT</pubDate>
            <atom:updated>2020-04-07T22:49:58.510Z</atom:updated>
            <content:encoded><![CDATA[<h3>5 Great Atom Packages</h3><h4>Recommendations</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*KvI8_s0qXfyvTIMP.png" /></figure><p>Atom is one of the best code editors used by thousands of developers. There are many reasons why Atom is one of the most popular editors but some of the main ones are that it is free and open-source, very approachable, and customizable.</p><p>Because of its popularity, Atom users/community create packages that can speed up your workflow and write code more efficiently.</p><p>Before I list some of the useful Atom packages, let&#39;s review how to install them using Mac:</p><p>1. Open Atom;<br>2. On top left corner of your screen click <strong>Atom</strong>;<br>3. In the drop-down menu navigate into <strong>Preferences </strong>(which opens settings page);<br>4. In the <strong>Settings</strong> page choose <strong>install</strong> from the menu;<br>5. In the search bar type the name of the package you are looking for;</p><p>Below I will list 5 useful and somewhat essential general-purpose Atom packages.</p><h3>1. Emmet</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c0UtOxn-ARHF-Uvu.png" /></figure><p>Emmet is one of the greatest packages because it is compatible with many languages across the board. It allows you to abbreviate some HTML and CSS code and write long text/code into shortcut strings.</p><h3><strong>2. Highlight Selected</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lt5Jtw7fUeYv_6jtGZI46w.png" /></figure><p>Highlight Selected is another very popular package which allows you to select and see where else the word is used in the file. This allows you to find, select, and modify the same instances in the file.</p><h3><strong>3. Atom Beautify</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lYQYWksILrnW9tfk8yX3Pg.png" /></figure><p>As you can view on the photo above, Atom Beautify allows you to format code to make it more readable and meet the coding standards and best practices. Beautify supports <strong>HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom</strong>.</p><h3><strong>4. Linter</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0fCcCWpIUs16Wch5GFidjg.png" /></figure><p>Linter helps to visualize errors. Different languages use different Linters, which can be found here: <a href="http://atomlinter.github.io/">Link</a>.</p><h3><strong>5. Pigment</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cRVUN2rT9sQ04hklQvY7fQ.png" /></figure><p>Finally, Pigment is another amazing and simple package that lets you see RGB and hex colors inside the editor as shown in the photo. It is very useful for your CSS/Sass files.</p><p>Resources:</p><ul><li><a href="https://atom.io/packages">A hackable text editor for the 21st Century</a></li><li><a href="https://wpdatatables.com/best-atom-packages/">The Best Atom Packages and Extensions You Can Install</a></li><li><a href="https://www.elegantthemes.com/blog/wordpress/best-atom-packages">13 Best Atom Packages for Web Developers</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a441893108ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Everyday Git Commands]]></title>
            <link>https://lukabaramishvili.medium.com/everyday-git-commands-1a775b602399?source=rss-42770fa81a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a775b602399</guid>
            <dc:creator><![CDATA[Luka]]></dc:creator>
            <pubDate>Mon, 16 Mar 2020 01:12:14 GMT</pubDate>
            <atom:updated>2020-03-16T01:12:14.274Z</atom:updated>
            <content:encoded><![CDATA[<p>Below I will be listing git commands that might be useful for everyday programming workflow.</p><h3>Show helpful guides that come with Git</h3><pre>git help -g</pre><h3>Search change by content</h3><pre>git log -S&#39;&lt;a term in the source&gt;&#39;</pre><h3>Show changes over time for specific file</h3><pre>git log -p &lt;file_name&gt;</pre><h3>Remove sensitive data from history, after a push</h3><pre>git filter-branch --force --index-filter &#39;git rm --cached --ignore-unmatch &lt;path-to-your-file&gt;&#39; --prune-empty --tag-name-filter cat -- --all &amp;&amp; git push origin --force --all</pre><h3>Sync with remote, overwrite local changes</h3><pre>git fetch origin &amp;&amp; git reset --hard origin/master &amp;&amp; git clean -f -d</pre><h3>List of all files till a commit</h3><pre>git ls-tree --name-only -r &lt;commit-ish&gt;</pre><h3>Git reset first commit</h3><pre>git update-ref -d HEAD</pre><h3>Reset: preserve uncommitted local changes</h3><pre>git reset --keep &lt;commit&gt;</pre><h3>List all the conflicted files</h3><pre>git diff --name-only --diff-filter=U</pre><h3>List of all files changed in a commit</h3><pre>git diff-tree --no-commit-id --name-only -r &lt;commit-ish&gt;</pre><h3>Unstaged changes since last commit</h3><pre>git diff</pre><h3>Changes staged for commit</h3><pre>git diff --cached</pre><p>Alternatives:</p><pre>git diff --staged</pre><h3>Show both staged and unstaged changes</h3><pre>git diff HEAD</pre><h3>List all branches that are already merged into master</h3><pre>git branch --merged master</pre><h3>Quickly switch to the previous branch</h3><pre>git checkout -</pre><p>Alternatives:</p><pre>git checkout @{-1}</pre><h3>Remove branches that have already been merged with master</h3><pre>git branch --merged master | grep -v &#39;^\*&#39; | xargs -n 1 git branch -d</pre><p>Alternatives:</p><pre>git branch --merged master | grep -v &#39;^\*\|  master&#39; | xargs -n 1 git branch -d # will not delete master if master is not checked out</pre><h3>List all branches and their upstreams, as well as last commit on branch</h3><pre>git branch -vv</pre><h3>Track upstream branch</h3><pre>git branch -u origin/mybranch</pre><h3>Delete local branch</h3><pre>git branch -d &lt;local_branchname&gt;</pre><h3>Delete remote branch</h3><pre>git push origin --delete &lt;remote_branchname&gt;</pre><p>Alternatives:</p><pre>git push origin :&lt;remote_branchname&gt;</pre><pre>git branch -dr &lt;remote/branch&gt;</pre><h3>Delete local tag</h3><pre>git tag -d &lt;tag-name&gt;</pre><h3>Delete remote tag</h3><pre>git push origin :refs/tags/&lt;tag-name&gt;</pre><h3>Undo local changes with the last content in head</h3><pre>git checkout -- &lt;file_name&gt;</pre><h3>Revert: Undo a commit by creating a new commit</h3><pre>git revert &lt;commit-ish&gt;</pre><h3>Reset: Discard commits, advised for private branch</h3><pre>git reset &lt;commit-ish&gt;</pre><h3>Reword the previous commit message</h3><pre>git commit -v --amend</pre><h3>See commit history for just the current branch</h3><pre>git cherry -v master</pre><h3>Amend author.</h3><pre>git commit --amend --author=&#39;Author Name &lt;email@address.com&gt;&#39;</pre><h3>Reset author, after author has been changed in the global config.</h3><pre>git commit --amend --reset-author --no-edit</pre><h3>Changing a remote’s URL</h3><pre>git remote set-url origin &lt;URL&gt;</pre><h3>Get list of all remote references</h3><pre>git remote</pre><p>Alternatives:</p><pre>git remote show</pre><h3>Get list of all local and remote branches</h3><pre>git branch -a</pre><h3>Get only remote branches</h3><pre>git branch -r</pre><h3>Stage parts of a changed file, instead of the entire file</h3><pre>git add -p</pre><h3>Get git bash completion</h3><pre>curl -L <a href="http://git.io/vfhol">http://git.io/vfhol</a> &gt; ~/.git-completion.bash &amp;&amp; echo &#39;[ -f ~/.git-completion.bash ] &amp;&amp; . ~/.git-completion.bash&#39; &gt;&gt; ~/.bashrc</pre><h3>What changed since two weeks?</h3><pre>git log --no-merges --raw --since=&#39;2 weeks ago&#39;</pre><p>Alternatives:</p><pre>git whatchanged --since=&#39;2 weeks ago&#39;</pre><h3>See all commits made since forking from master</h3><pre>git log --no-merges --stat --reverse master..</pre><h3>Pick commits across branches using cherry-pick</h3><pre>git checkout &lt;branch-name&gt; &amp;&amp; git cherry-pick &lt;commit-ish&gt;</pre><h3>Find out branches containing commit-hash</h3><pre>git branch -a --contains &lt;commit-ish&gt;</pre><p>Alternatives:</p><pre>git branch --contains &lt;commit-ish&gt;</pre><h3>Git Aliases</h3><pre>git config --global alias.&lt;handle&gt; &lt;command&gt; <br>git config --global alias.st status</pre><h3>Saving current state of tracked files without commiting</h3><pre>git stash</pre><p>Alternatives:</p><pre>git stash save</pre><h3>Saving current state of unstaged changes to tracked files</h3><pre>git stash -k</pre><p>Alternatives:</p><pre>git stash --keep-index</pre><pre>git stash save --keep-index</pre><h3>Saving current state including untracked files</h3><pre>git stash -u</pre><p>Alternatives:</p><pre>git stash save -u</pre><pre>git stash save --include-untracked</pre><h3>Saving current state with message</h3><pre>git stash save &lt;message&gt;</pre><h3>Saving current state of all files (ignored, untracked, and tracked)</h3><pre>git stash -a</pre><p>Alternatives:</p><pre>git stash --all</pre><pre>git stash save --all</pre><h3>Show list of all saved stashes</h3><pre>git stash list</pre><h3>Apply any stash without deleting from the stashed list</h3><pre>git stash apply &lt;stash@{n}&gt;</pre><h3>Apply last stashed state and delete it from stashed list</h3><pre>git stash pop</pre><p>Alternatives:</p><pre>git stash apply stash@{0} &amp;&amp; git stash drop stash@{0}</pre><h3>Delete all stored stashes</h3><pre>git stash clear</pre><p>Alternatives:</p><pre>git stash drop &lt;stash@{n}&gt;</pre><h3>Grab a single file from a stash</h3><pre>git checkout &lt;stash@{n}&gt; -- &lt;file_path&gt;</pre><p>Alternatives:</p><pre>git checkout stash@{0} -- &lt;file_path&gt;</pre><h3>Show all tracked files</h3><pre>git ls-files -t</pre><h3>Show all untracked files</h3><pre>git ls-files --others</pre><h3>Show all ignored files</h3><pre>git ls-files --others -i --exclude-standard</pre><h3>Create new working tree from a repository (git 2.5)</h3><pre>git worktree add -b &lt;branch-name&gt; &lt;path&gt; &lt;start-point&gt;</pre><h3>Create new working tree from HEAD state</h3><pre>git worktree add --detach &lt;path&gt; HEAD</pre><h3>Untrack files without deleting</h3><pre>git rm --cached &lt;file_path&gt;</pre><p>Alternatives:</p><pre>git rm --cached -r &lt;directory_path&gt;</pre><h3>Before deleting untracked files/directory, do a dry run to get the list of these files/directories</h3><pre>git clean -n</pre><h3>Forcefully remove untracked files</h3><pre>git clean -f</pre><h3>Forcefully remove untracked directory</h3><pre>git clean -f -d</pre><h3>Update all the submodules</h3><pre>git submodule foreach git pull</pre><p>Alternatives:</p><pre>git submodule update --init --recursive</pre><pre>git submodule update --remote</pre><h3>Show all commits in the current branch yet to be merged to master</h3><pre>git cherry -v master</pre><p>Alternatives:</p><pre>git cherry -v master &lt;branch-to-be-merged&gt;</pre><h3>Rename a branch</h3><pre>git branch -m &lt;new-branch-name&gt;</pre><p>Alternatives:</p><pre>git branch -m [&lt;old-branch-name&gt;] &lt;new-branch-name&gt;</pre><h3>Rebases ‘feature’ to ‘master’ and merges it in to master</h3><pre>git rebase master feature &amp;&amp; git checkout master &amp;&amp; git merge -</pre><h3>Archive the master branch</h3><pre>git archive master --format=zip --output=master.zip</pre><h3>Modify previous commit without modifying the commit message</h3><pre>git add --all &amp;&amp; git commit --amend --no-edit</pre><h3>Prunes references to remote branches that have been deleted in the remote.</h3><pre>git fetch -p</pre><p>Alternatives:</p><pre>git remote prune origin</pre><h3>Retrieve the commit hash of the initial revision.</h3><pre>git rev-list --reverse HEAD | head -1</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a775b602399" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git Search, Commit History, & Move/Rename Commands [Cheatsheet]]]></title>
            <link>https://lukabaramishvili.medium.com/git-search-commit-history-move-rename-commands-cheatsheet-9463a0bc145f?source=rss-42770fa81a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/9463a0bc145f</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Luka]]></dc:creator>
            <pubDate>Sun, 08 Mar 2020 23:06:20 GMT</pubDate>
            <atom:updated>2020-03-16T21:52:29.998Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/778/0*zcBH-0fYmSNGPtnf.png" /></figure><p>No matter how small your codebase is, you’ll often need to find where a function is called or defined, or display the history of a method, especially when codebase grows. Git provides a couple of useful tools for looking through the code and commits stored in its database quickly and easily. I will try to go through some of the useful commands that are used to not only search but find, view and commit history.</p><h3>Search</h3><p>A text search on all files in the directory:</p><pre>$ git grep &quot;Hello&quot;</pre><p>In any version of a text search:</p><pre>$ git grep &quot;Hello&quot; v2.5</pre><h3>Commit History</h3><p>Show all commits, starting with newest (it’ll show the hash, author information, date of commit and title of the commit):</p><pre>$ git log</pre><p>Show all the commits(it’ll show just the commit hash and the commit message):</p><pre>$ git log --oneline</pre><p>Show all commits of a specific user:</p><pre>$ git log --author=&quot;username&quot;</pre><p>Show changes over time for a specific file:</p><pre>$ git log -p &lt;file&gt;</pre><p>Display commits that are present only in remote/branch in right side</p><pre>$ git log --oneline &lt;origin/master&gt;..&lt;remote/master&gt; --left-right</pre><p>Who changed, what and when in &lt;file&gt;:</p><pre>$ git blame &lt;file&gt;</pre><p>Show Reference log:</p><pre>$ git reflog show</pre><p>Delete Reference log:</p><pre>$ git reflog delete</pre><h3>Move / Rename</h3><p>Rename a file:</p><p>Rename Index.txt to Index.html</p><pre>$ git mv Index.txt Index.html</pre><p>resources:</p><ul><li><a href="https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History">Git - Viewing the Commit History</a></li><li><a href="https://travisjeffery.com/b/2012/02/search-a-git-repo-like-a-ninja/">Search a git repo like a ninja</a></li><li><a href="https://www.poftut.com/how-to-list-commit-history-with-git-log-command-with-examples/">How To List Commit History with Git Log Command with Examples? - POFTUT</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9463a0bc145f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git Update & Publish Commands[Cheatsheet]]]></title>
            <link>https://lukabaramishvili.medium.com/git-update-publish-commands-cheatsheet-b80c485bb11e?source=rss-42770fa81a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/b80c485bb11e</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Luka]]></dc:creator>
            <pubDate>Mon, 02 Mar 2020 02:11:47 GMT</pubDate>
            <atom:updated>2020-03-02T02:11:47.590Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-52EMwDyQ79bYrRZ" /><figcaption><a href="https://github.blog/2019-01-07-new-year-new-github/">https://github.blog/2019-01-07-new-year-new-github/</a></figcaption></figure><p>There are not very many commands in Git that access the network, nearly all of the commands operate on the local database. When you are ready to share your work or pull changes from elsewhere, there are a handful of commands that deal with remote repositories.</p><p>List all current configured remotes:</p><pre>$ git remote -v</pre><p>Show information about a remote:</p><pre>$ git remote show &lt;remote&gt;</pre><p>Add new remote repository, named &lt;remote&gt;:</p><pre>$ git remote add &lt;remote&gt; &lt;url&gt;</pre><p>Rename a remote repository, from &lt;remote&gt; to &lt;new_remote&gt;:</p><pre>$ git remote rename &lt;remote&gt; &lt;new_remote&gt;</pre><p>Remove a remote:</p><pre>$ git remote rm &lt;remote&gt;</pre><p><em>Note: git remote rm does not delete the remote repository from the server. It simply removes the remote and its references from your local repository.</em></p><p>Download all changes from &lt;remote&gt;, but don’t integrate into HEAD:</p><pre>$ git fetch &lt;remote&gt;</pre><p>Download changes and directly merge/integrate into HEAD:</p><pre>$ git remote pull &lt;remote&gt; &lt;url&gt;</pre><p>Get all changes from HEAD to local repository:</p><pre>$ git pull origin master</pre><p>Get all changes from HEAD to local repository without a merge:</p><pre>$ git pull --rebase &lt;remote&gt; &lt;branch&gt;</pre><p>Publish local changes on a remote:</p><pre>$ git push remote &lt;remote&gt; &lt;branch&gt;</pre><p>Delete a branch on the remote:</p><pre>$ git push &lt;remote&gt; :&lt;branch&gt; (since Git v1.5.0)</pre><p>OR</p><pre>$ git push &lt;remote&gt; --delete &lt;branch&gt; (since Git v1.7.0)</pre><p>Publish your tags:</p><pre>$ git push --tags</pre><h4>Configure the merge tool globally to meld (editor)</h4><pre>$ git config --global merge.tool meld</pre><p>Use your configured merge tool to solve conflicts:</p><pre>$ git mergetool</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EsH2gORKGthgMNN9.png" /></figure><p>Resources:</p><ul><li><a href="https://www.git-tower.com/learn/git/ebook/en/command-line/remote-repositories/publish-local-branch">Publishing a Local Branch</a></li><li><a href="https://git-scm.com/book/sr/v2/Appendix-C%3A-Git-Commands-Sharing-and-Updating-Projects">Git - Sharing and Updating Projects</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b80c485bb11e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Art of Command Line]]></title>
            <link>https://lukabaramishvili.medium.com/art-of-command-line-66be6dfa2cc2?source=rss-42770fa81a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/66be6dfa2cc2</guid>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[bash]]></category>
            <dc:creator><![CDATA[Luka]]></dc:creator>
            <pubDate>Mon, 24 Feb 2020 00:00:07 GMT</pubDate>
            <atom:updated>2020-03-17T02:53:31.350Z</atom:updated>
            <content:encoded><![CDATA[<h4>Basic Everyday use [BASH]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*849cqM87l7r2eNGI.png" /></figure><p>Being a Software Engineer involves familiarizing oneself not only with programming languages, frameworks and libraries, but with many other developing tools as such management tools, git, etc. Depending on our working methodologies and practices, we all end up using different tools to achieve our goals. However, Command Line is something most that most of us end up using.</p><p><strong>What is Command Line?</strong></p><p>Command Line is an interface that processes commands for computer by utilizing texts and lines. Different operating systems use different command lines. It is how we are able to jump between files and directories, open softwares, run simple scripts and check the status of things. On MacOs it is called “Terminal”, while on Windows it’s called “Command Prompt”.<br>The default <strong>Shell</strong> on both operating systems is Bash, or or “Bourne-Again <strong>Shell</strong>” and it’s a text-based shell for controlling the computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/0*LzkbQ4b64zKVTOcz.png" /></figure><p>This article cover only BASH commands on MacOs.</p><p>Lets start by opening up the Terminal by opening up Spotlight search tool on Mac by clicking ⌘<strong>Command + Space. </strong>As We open up the Terminal we see a prompt that allows us to type commands that will allow us to navigate through it. if we type in<strong>Cd document </strong>shell will navigate to that specifically named “documents” directory, or in another words, in that folder. Another very useful command is <strong>ls </strong>or <strong>list</strong>, that list all the folders and files (content) inside that directory. <br>Many Commands will have options, expressed as “-” (dash). Options give extra functionality to each and individual commands. For example <strong>ls -l </strong>shows one folder per line, with all the extra information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/0*FynyOop1NiIjAg4n.png" /></figure><p>Here I will list some of the basic and useful shortcuts to begin your command line learning experience:</p><ul><li><strong>ctrl-w- </strong>to delete the last word typed in prompt.</li><li><strong>ctrl-u</strong>to delete the content from current cursor back to the start of the line.</li><li><strong>alt-b</strong> and alt-f to move by word</li><li><strong>ctrl-a</strong> to move cursor to beginning of line</li><li><strong>ctrl-e</strong> to move cursor to end of line</li><li><strong>ctrl-k</strong> to kill to the end of the line</li><li><strong>ctrl-l</strong> to clear the screen</li></ul><p>In the end, there are a lot of useful commands that will be useful to learn. Command line is an art, therefore every developer utilizes is on their own way. <br>The most useful command you can remember is <strong>man </strong>which stands for manual. If you type <strong>man ls , </strong>terminal will show you all the commands that are associated with ls.</p><p>Resources:</p><ul><li><a href="https://www.computerhope.com/jargon/c/commandi.htm">What is the Command Line?</a></li><li><a href="https://en.wikipedia.org/wiki/Command-line_interface">Command-line interface - Wikipedia</a></li><li><a href="https://tutorial.djangogirls.org/en/intro_to_command_line/">Introduction to command line</a></li><li><a href="https://www.codecademy.com/articles/command-line-commands">List of Command Line Commands | Codecademy</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66be6dfa2cc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brief Introduction to Docker]]></title>
            <link>https://lukabaramishvili.medium.com/brief-introduction-to-docker-8818cacb3a11?source=rss-42770fa81a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/8818cacb3a11</guid>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Luka]]></dc:creator>
            <pubDate>Sun, 16 Feb 2020 15:30:00 GMT</pubDate>
            <atom:updated>2020-03-16T21:26:55.973Z</atom:updated>
            <content:encoded><![CDATA[<h4>containerization</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AWWp715YD8Aja56P.png" /></figure><p>Most organizations either have or want to have a strategy for moving some part of their IT estate to containers. It is an important subset of a “move to cloud” strategy. Today’s technologies allow us to scale up development process easily, efficiently, with less expense.<br>Most effective way to move some or all your estate in cloud, companies need to run their components in container technologies that later is orchestrated or managed with technologies such as Kubernetes. More on Kubernetes later.</p><p><strong>What does Docker has to do with containerization? </strong><br>Docker is a containerization platform that packages your application and all its dependencies together in the form of a docker container or one package to ensure that your application works seamlessly in any environment. Containers such as Docker allow developers to package up the whole application, with it’s own libraries and dependences and deploy anywhere as a one package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cuPVj1R019u-kN1D.png" /></figure><p>One of the goals of modern software development is to keep applications on the same host or cluster isolated from one another so they don’t interfere with each other’s operation or maintenance. This can be difficult, thanks to the packages, libraries, and other software components required for them to run. One solution to this problem has been <em>virtual machines,</em> which keep applications on the same hardware entirely separate, and reduce conflicts among software components and competition for hardware resources to a minimum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hGhDj7F3kYTsWw0E.png" /><figcaption>source: IBM</figcaption></figure><p><strong>Getting Started:</strong></p><p><a href="https://docs.docker.com/engine/docker-overview/">These are</a> some resources that will help you to get started with Docker.<br>If you are a visual learner like me please watch this comprehensive video for detailed explanation.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FQ5POuMHxW-0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DQ5POuMHxW-0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FQ5POuMHxW-0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f33c462a1f92288d10d7152a1e16e5ec/href">https://medium.com/media/f33c462a1f92288d10d7152a1e16e5ec/href</a></iframe><p>Other Resources:</p><ul><li><a href="https://opensource.com/resources/what-docker">What is Docker?</a></li><li><a href="https://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/">What is Docker and why is it so darn popular?</a></li><li><a href="https://en.wikipedia.org/wiki/Docker_(software)">Docker (software) - Wikipedia</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8818cacb3a11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git Merge & Rebase Commands[cheatsheet]]]></title>
            <link>https://lukabaramishvili.medium.com/git-merge-rebase-commands-cheatsheet-eba3f477dff5?source=rss-42770fa81a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/eba3f477dff5</guid>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Luka]]></dc:creator>
            <pubDate>Sun, 09 Feb 2020 15:30:00 GMT</pubDate>
            <atom:updated>2020-03-16T20:56:45.782Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/855/0*HjzViUiFpO3_nTOS.png" /></figure><p>Git <strong>merge </strong>and git <strong>rebase</strong>, both are used to commit changes from one branch into another. The distinction is that both commands are accomplishing this service differently. “Rebasing <em>re-writes</em> the project history by creating brand new commits for each commit in the original branch.” Below are some useful commands for merging and rebasing.</p><h3>Merge &amp; Rebase</h3><p>Merge branch into your current HEAD:</p><pre>$ git merge &lt;branch&gt;</pre><p>Rebase your current HEAD onto &lt;branch&gt;:</p><p><em>Don’t rebase published commit!</em></p><pre>$ git rebase &lt;branch&gt;</pre><p>Abort a rebase:</p><pre>$ git rebase --abort</pre><p>Continue a rebase after resolving conflicts:</p><pre>$ git rebase --continue</pre><p>Use your editor to manually solve conflicts and (after resolving) mark file as resolved:</p><pre>$ git add &lt;resolved-file&gt;</pre><pre>$ git rm &lt;resolved-file&gt;</pre><p>Squashing commits:</p><pre>$ git rebase -i &lt;commit-just-before-first&gt;</pre><p>Now replace this,</p><pre>pick &lt;commit_id&gt;<br>pick &lt;commit_id2&gt;<br>pick &lt;commit_id3&gt;</pre><p>to this,</p><pre>pick &lt;commit_id&gt;<br>squash &lt;commit_id2&gt;<br>squash &lt;commit_id3&gt;</pre><p>Resources:</p><ul><li><a href="https://www.atlassian.com/git/tutorials/merging-vs-rebasing">Merging vs. Rebasing | Atlassian Git Tutorial</a></li><li><a href="https://git-scm.com/book/en/v2/Git-Branching-Rebasing">Git - Rebasing</a></li><li><a href="https://hackernoon.com/git-merge-vs-rebase-whats-the-diff-76413c117333">Git Merge vs. Rebase: What&#39;s the Diff?</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eba3f477dff5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Useful Git Commands for Local Changes [cheatsheet]]]></title>
            <link>https://lukabaramishvili.medium.com/useful-git-commands-for-local-changes-cheatsheet-344fe0a959fe?source=rss-42770fa81a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/344fe0a959fe</guid>
            <category><![CDATA[manipulation]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Luka]]></dc:creator>
            <pubDate>Sun, 02 Feb 2020 15:30:00 GMT</pubDate>
            <atom:updated>2020-03-16T21:48:38.464Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8EDuMbjEE18h9diM.jpg" /><figcaption>Source: <a href="https://www.theverge.com/2019/5/6/18531222/hacker-data-theft-ransom-stolen-git-code-bitcoin">https://www.theverge.com/2019/5/6/18531222/hacker-data-theft-ransom-stolen-git-code-bitcoin</a></figcaption></figure><p>In this article I will talk about how to handle local changes and version control your project with Git.</p><p>After initializing project in Git, our files in working directory can be either in <strong>tracked</strong> or <strong>untacked</strong> state. As you might guess, tracked files are the ones git knows about, therefore they can be modified, unmodified and staged for committing. Below I will be showing useful commands to interact with files that are tracked and in stage state.</p><h3>Local Changes</h3><p><strong>Changes in working directory:</strong></p><pre>$ git status</pre><p>The main tool, $ git status tells us which file is in which state in your working directory. What is great about this command is that it also shows if there are any untracked files as well as which branch you are on.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Changes to tracked files:</strong></p><pre>$ git diff</pre><p>$ git diff is very similar to $ git status . However the advantage of $ git diff is that it shows what have you changed but not staged yet. Another advantage is that it not only shows which files were changed but exact lines of what were added or removed.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>See changes/difference of a specific file:</strong></p><pre>$ git diff &lt;file&gt;</pre><p>This command accomplishes same as $ git diff , but inside specifying file.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Add all current changes to the next commit:</strong></p><pre>$ git add .</pre><p>We initially use $ git add . to begin tracking files, however we use the same command to stage modified files as well as marking merge-conflicted files. Running $ git add . and then making changes will not be staged. Therefore, even after making slight change we need to run $ git add . again to track last modifications.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Add some changes in &lt;file&gt; to the next commit:</strong></p><pre>$ git add -p &lt;file&gt;</pre><p>This command accomplishes same as $ git add . , but inside specifying file.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Commit all local changes in tracked files:</strong></p><pre>$ git commit -a</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Commit previously staged changes:</strong></p><pre>$ git commit</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Commit with message:</strong></p><pre>$ git commit -m &#39;message here&#39;</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Commit skipping the staging area and adding message:</strong></p><pre>$ git commit -am &#39;message here&#39;</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Commit to some previous date:</strong></p><pre>$ git commit --date=&quot;`date --date=&#39;n day ago&#39;`&quot; -am &quot;&lt;Commit Message Here&gt;&quot;</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Change last commit:</strong></p><p><em>Don’t amend published commits!</em></p><pre>$ git commit -a --amend</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Amend with last commit but use the previous commit log message</strong></p><p><em>Don’t amend published commits!</em></p><pre>$ git commit --amend --no-edit</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Change committer date of last commit:</strong></p><pre>GIT_COMMITTER_DATE=&quot;date&quot; git commit --amend</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Change Author date of last commit:</strong></p><pre>$ git commit --amend --date=&quot;date&quot;</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Move uncommitted changes from current branch to some other branch:</strong></p><pre>$ git stash<br>$ git checkout branch2<br>$ git stash pop</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Restore stashed changes back to current branch:</strong></p><pre>$ git stash apply</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><h3>Restore particular stash back to current branch:</h3><ul><li><em>{stash_number}</em> can be obtained from git stash list</li></ul><pre>$ git stash apply stash@{stash_number}</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Remove the last set of stashed changes:</strong></p><pre>$ git stash drop</pre><p>Resources:</p><ul><li><a href="https://confluence.atlassian.com/bitbucketserver/basic-git-commands-776639767.html">Basic Git commands</a></li><li><a href="https://githowto.com/staging_changes">6. Staging the changes</a></li><li><a href="https://softwareengineering.stackexchange.com/questions/119782/what-does-stage-mean-in-git">What does &#39;stage&#39; mean in git?</a></li><li><a href="https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository">Git - Recording Changes to the Repository</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=344fe0a959fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>