<?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 Masud Afsar on Medium]]></title>
        <description><![CDATA[Stories by Masud Afsar on Medium]]></description>
        <link>https://medium.com/@masudafsar?source=rss-45d130b9cc27------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8aj-eDv6OkQuF88_VtmO6A.jpeg</url>
            <title>Stories by Masud Afsar on Medium</title>
            <link>https://medium.com/@masudafsar?source=rss-45d130b9cc27------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 21:40:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@masudafsar/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[Configure Visual Studio Code as a default git editor, diff tool, or merge tool]]></title>
            <link>https://medium.com/geekculture/configure-visual-studio-code-as-a-default-git-editor-diff-tool-or-merge-tool-291fd7088cc9?source=rss-45d130b9cc27------2</link>
            <guid isPermaLink="false">https://medium.com/p/291fd7088cc9</guid>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[geek]]></category>
            <dc:creator><![CDATA[Masud Afsar]]></dc:creator>
            <pubDate>Wed, 13 Apr 2022 05:02:34 GMT</pubDate>
            <atom:updated>2024-03-19T13:51:46.932Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Configure visual studio code as a default git editor, diff tool, or merge tool" src="https://cdn-images-1.medium.com/max/1024/0*KFIfRaOIxcz21KhL" /><figcaption>Photo by <a href="https://unsplash.com/@pankajpatel?utm_source=medium&amp;utm_medium=referral">Pankaj Patel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I’m using Visual Studio Code as a fixed tool for a lot of opportunities like opening and editing files and sources quickly because it’s light and fast for me. After a while, I look at VS Code and think, about why I’m not using it as a git tool to write commit messages, get a diff between files, or resolve merge conflicts.</p><p>So I found VS Code can be configured as a really convenient tool inside the git.</p><h3>Run VS Code from the command line</h3><p>Before you can use VS Code as a git editor you must ensure you can access and run it from the command line. You can test the access VS Code by running the CLI command below.</p><pre>$ code --version<br>1.66.0<br>e18005f0f1b33c29e81d732535d8c0e47cafb0b5<br>x64</pre><p>If the command is not found you must introduce VS Code to your operating system to run it from CLI:</p><ul><li>Windows: you must add the location of the VS Code installation to the PATH variable in the Environment Variables setting.</li><li>Mac OS: Press CMD+Shift+P keys and type Shell Command: Install &#39;Code&#39; command in PATH in the command palette.</li><li>Linux: You must install VS Code from the .deb or .rpm packages file.</li></ul><h3>Use VS Code instead of nano as the default git editor</h3><p>The default git editor is Nano, I used to use vim as a git editor until I found VS Code is convenient for that. you can configure VS Code as the default editor with the command below:</p><pre>$ git config --global core.editor &quot;code --wait --new-window&quot;</pre><p>This command opens VS Code in a new window and git waits until it saves contents and closes the window. You can remove VS Code by command below:</p><pre>$ git config --global --unset core.editor</pre><h3>Use VS Code as git default diff tool and merge tool</h3><p>The default git diff tool is vimdiff, and you can set it by commands below:</p><pre>$ git config --global diff.tool vscode<br>$ git config --global difftool.vscode.cmd &#39;code --wait --diff $LOCAL $REMOTE&#39;</pre><p>You can unset these configs by commands below:</p><pre>$ git config --global --unset diff.tool<br>$ git config --global --unset difftool.vscode.cmd</pre><p>Git doesn’t have a default merge tool, you can use vimdiff for the merge tool too, or set VS Code as default by the command below:</p><pre>$ git config --global merge.tool vscode<br>$ git config --global mergetool.vscode.cmd &#39;code --wait $MERGED&#39;</pre><p>You can unset these configs like diff tools by using the --unset flag after the config command.</p><p>My global git config file after these changes is like this:</p><pre>$ cat ~/.gitconfig<br>...<br>[merge]<br> tool = vscode<br>[core]<br> editor = code --wait --new-window<br>[difftool &quot;vscode&quot;]<br> cmd = code --wait --diff $LOCAL $REMOTE<br>[diff]<br> tool = vscode<br>[mergetool &quot;vscode&quot;]<br> cmd = code --wait $MERGED<br>...</pre><p>You can copy all these lines into your git config files in your home directory (~/.gitconfig) to set all commands above.</p><h3>Conclusion</h3><p>I always prefer to use the default CLI tools like vim to work with git and other command-line tools because sometimes you need to work with git and bash in a headless server with only default tools installed on it, so you need to know how to work with these tools at first. On the other hand, GUI tools help us to do things faster and not get confused in complex situations; VS Code is one of the best free tools you can use as an editor and comparing tools in your development environment.</p><h3>Resources</h3><ul><li><a href="https://git-scm.com/doc">git official documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=291fd7088cc9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/configure-visual-studio-code-as-a-default-git-editor-diff-tool-or-merge-tool-291fd7088cc9">Configure Visual Studio Code as a default git editor, diff tool, or merge tool</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to install Node.js by NVM?]]></title>
            <link>https://medium.com/geekculture/how-to-install-node-js-by-nvm-61addf4ab1ba?source=rss-45d130b9cc27------2</link>
            <guid isPermaLink="false">https://medium.com/p/61addf4ab1ba</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Masud Afsar]]></dc:creator>
            <pubDate>Tue, 14 Sep 2021 11:17:06 GMT</pubDate>
            <atom:updated>2023-05-12T21:29:19.933Z</atom:updated>
            <content:encoded><![CDATA[<h4>Install and manage multiple versions of Node.js with nvm.</h4><p>Sometimes, when I explore GitHub and clone some Node.js projects, It’s not compatible with my current installed Node.js, and I need to install the other version of that. NVM makes it easier and let us install and manage multiple version of Node.js on your local machine.</p><figure><img alt="Adventure in Node.js versions with nvm" src="https://cdn-images-1.medium.com/max/1024/0*PGs4PwG6HPYRA_3o" /><figcaption>Photo by <a href="https://unsplash.com/@sadswim?utm_source=medium&amp;utm_medium=referral">Ian Dooley</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Install nvm on Ubuntu and Mac OS</h3><p>There’s some way to install or update nvm on your machine, but I prefer to install nvm with the <a href="https://github.com/nvm-sh/nvm">installer script</a>. When I wrote this article, the latest version of the nvm installer was 0.38.0. So, you can use curl it to download and then run it with bash with the command below in the terminal.</p><pre>curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash</pre><p>or with wget:</p><pre>wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash</pre><p>After that, the installer will clone the nvm repository into ~/.nvm/ directory and you should add some lines below at the end of ~/.bashrc file to load nvm.</p><pre>export NVM_DIR=&quot;$HOME/.nvm&quot;<br># This loads nvm<br>[ -s &quot;$NVM_DIR/nvm.sh&quot; ] &amp;&amp; \. &quot;$NVM_DIR/nvm.sh&quot;<br># This loads nvm bash_completion<br>[ -s &quot;$NVM_DIR/bash_completion&quot; ] &amp;&amp; \. &quot;$NVM_DIR/bash_completion&quot;</pre><p>Now you need to close and reopen the terminal to load nvm, then check and verify your installation</p><pre>nvm --version<br># 0.38.0</pre><p>Now nvm is ready to use.</p><h3>Use nvm to manage Node.js versions</h3><p>Nvm has a lot of subcommands such as install, use, uninstall, and more. We want to choose some essential subcommands and explain them.</p><h4>Install a version of Node.js</h4><p>First, you can get the list of available versions by list-remote or ls-remote subcommand.</p><pre>nvm list-remote # or nvm ls-remote</pre><p>You can install a specific version by nvm with install subcommand.</p><pre>nvm install &lt;version&gt; # like: 14.17.6</pre><p>If you want to install the LTS version you can use --lts instead of version number.</p><pre>nvm install --lts</pre><p>Or you can install the latest version with node instead of version number.</p><pre>nvm install node</pre><h4>Load a specific version of Node.js</h4><p>Now you install some versions of Node.js on your machine; So you can see the list of installed versions with list or ls subcommand.</p><pre>nvm list # or nvm ls</pre><p>If you want to load a specific version, use use subcommand. With this subcommand, you can load Node.js by version number or --lts flag.</p><pre>nvm use &lt;version&gt;</pre><p>Or use the LTS version</p><pre>nvm use --lts</pre><p>Or use the latest version</p><pre>nvm use node</pre><h4>Uninstall a Node.js version</h4><p>Finally, If you want to uninstall a version of Node.js, you can use uninstall subcommand for that.</p><p>First, you need to switch to another version with use then you can uninstall that.</p><pre>nvm uninstall &lt;version&gt;</pre><h3>What’s the .nvmrc file?</h3><p>In the Node.js project, you can store the version of Node.js compatible with that in a file, they called it .nvmrc and you should create it in the root directory of your project.</p><pre>node --version &gt; /path/to/project/.nvmrc</pre><p>Then you can use the compatible version on other machines of your teammates.</p><pre>nvm use<br># Found &#39;/path/to/project/.nvmrc&#39; with version &lt;v14.17.6&gt;<br># Now using node v14.17.6 (npm v6.14.15)</pre><h3>Install a package on Node.js</h3><p>Installing a package on Node.js installed by NVM is the same as the regular installation of node.js, but the installation of the package is based on the version number.</p><pre>nvm use 14.17.5<br>npm install --global yarn<br>which yarn<br># ~/.nvm/versions/node/v14.17.5/bin/yarn</pre><h3>Conclusion</h3><p>NVM helps us to have some node.js versions together in a machine and use them in our project or test features of dev versions without side effects on our system or project.</p><p>So, I recommended using it to install Node.js and manage that easily.</p><h3>Resources:</h3><p><a href="https://github.com/nvm-sh/nvm">GitHub - nvm-sh/nvm: Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61addf4ab1ba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/how-to-install-node-js-by-nvm-61addf4ab1ba">How to install Node.js by NVM?</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HOW TO IN UNITY: Setting up Git and Git-LFS]]></title>
            <link>https://masudafsar.medium.com/how-to-in-unity-setting-up-git-and-git-lfs-d15109d9f11e?source=rss-45d130b9cc27------2</link>
            <guid isPermaLink="false">https://medium.com/p/d15109d9f11e</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[gamedev]]></category>
            <category><![CDATA[teamwork]]></category>
            <dc:creator><![CDATA[Masud Afsar]]></dc:creator>
            <pubDate>Mon, 14 Jan 2019 12:53:57 GMT</pubDate>
            <atom:updated>2021-11-12T07:01:38.389Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to set up Git and Git-LFS in Unity</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8LLIJ85pLow_iGTPr0GrMw.png" /><figcaption>using version control in the game development</figcaption></figure><h4>The first question: Why Git?</h4><p>Real game studios generally have multiple developers, artists, and a lot of other roles working simultaneously on a game. So to ensure there are no conflicts in the codes or game assets between them, they need to use a version control system like Git to track file changes. Additionally, they need to revert changes and go back to an older version of the game or develop each feature in a separate branch.</p><h4>The second question: How to set up Git?</h4><p>Now, let’s explain installing and configuring Git and Git-LFS</p><ul><li>Download and install Git based on your platform (<a href="http://git-scm.com/download/mac">Mac</a>, <a href="http://git-scm.com/download/win">Windows</a>)</li><li>Open Terminal (or git-bash in windows) and type this command to ensure it’s installed correctly:</li></ul><pre><strong>$</strong> git --version<br>git version 2.20.1</pre><ul><li>The first thing you should do after installing Git is to set your name and email address. This is important because every Git commit uses this information:</li></ul><pre><strong>$</strong> git config --global user.name &quot;<strong><em>Your Name</em></strong>&quot;<br><strong>$</strong> git config --global user.email &quot;<strong><em>your Email Address&quot;</em></strong></pre><p>After Git, now prepare to install two important extensions on it: First, Git-LFS to manage game assets and large files, then Git-Flow to manage branches and workflow.</p><ul><li><a href="https://github.com/git-lfs/git-lfs/releases/tag/v2.6.1">Download</a> and install Git-LFS on your platform and type this command in Terminal to ensure it’s installed correctly:</li></ul><pre><strong>$</strong> git lfs version<br>git-lfs/2.6.1 (GitHub; darwin amd64; go 1.11.2)</pre><ul><li><a href="https://github.com/nvie/gitflow/wiki/Installation">Install</a> Git-Flow and type this command in Terminal to ensure it’s installed correctly:</li></ul><pre><strong>$</strong> git flow version<br>0.4.1</pre><p>Git is now ready to be used in your project!</p><h4>The third question: How to prepare Unity3D projects to use Git?</h4><p>When you want to use Git in Unity projects, you must set some config on it and add several config files in your project.</p><ul><li>Open Unity and select your project. Then go to Edit &gt; Project settings &gt; Editor from menu. In the opened window, set Version Control Mode on Visible Meta Files and Asset Serialization Mode on Force Text like this:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uuLl5w26hlhMW8UtWk00_A.png" /><figcaption>Unity editor setting to prepare using version control systems</figcaption></figure><ul><li>If your team works on different platforms, it is better to set Line Endings For New Scripts Mode on Unix.</li><li>Now create <strong>.gitignore</strong> file in the root directory of your project to ignore auto-generated files and directories from Git tracking:</li></ul><pre># OS auto-generated files<br>.DS_Store<br>*.db<br><br># Unity3D auto-generated folders<br>/[Ll]ibrary/<br>/[Tt]emp/<br>/[Oo]bj/<br>/[Bb]uild/<br>/[Bb]uilds/<br>/[Uu]nityGenerated/<br>/[Ll]ocal[Cc]ache/<br><br># Auto-generated Visual Studio or MonoDevelop solution and project files<br>*.csproj<br>*.unityproj<br>*.sln<br>*.suo<br>*.tmp<br>*.user<br>*.userprefs<br>*.pidb<br>*.booproj<br>*.apk<br>*.cd<br>.consulo/<br>*.svd<br>*.pdb<br>*.opendb<br><br># Unity3D generated meta files<br>*.pidb.meta<br>*.pdb.meta<br><br># Unity3D Generated File On Crash Reports<br>sysinfo.txt<br><br># Builds<br>*.apk<br>*.exe<br>*.unitypackage</pre><ul><li>Now you must set the behavior of the Git file tracker about the text or binary files in <strong>.gitattribute</strong> file:</li></ul><pre>## Unity ##<br><br>*.cs                diff=csharp text<br>*.cginc             text<br>*.shader            text<br><br>*.mat               merge=unityyamlmerge eol=lf<br>*.anim              merge=unityyamlmerge eol=lf<br>*.unity             merge=unityyamlmerge eol=lf<br>*.prefab            merge=unityyamlmerge eol=lf<br>*.physicsMaterial2D merge=unityyamlmerge eol=lf<br>*.physicsMaterial   merge=unityyamlmerge eol=lf<br>*.asset             merge=unityyamlmerge eol=lf<br>*.meta              merge=unityyamlmerge eol=lf<br>*.controller        merge=unityyamlmerge eol=lf<br><br>## git-lfs ##<br><br>#Image<br>*.jpg               filter=lfs diff=lfs merge=lfs -text<br>*.jpeg              filter=lfs diff=lfs merge=lfs -text<br>*.png               filter=lfs diff=lfs merge=lfs -text<br>*.gif               filter=lfs diff=lfs merge=lfs -text<br>*.psd               filter=lfs diff=lfs merge=lfs -text<br>*.ai                filter=lfs diff=lfs merge=lfs -text<br><br>#Audio<br>*.mp3               filter=lfs diff=lfs merge=lfs -text<br>*.wav               filter=lfs diff=lfs merge=lfs -text<br>*.ogg               filter=lfs diff=lfs merge=lfs -text<br><br>#Video<br>*.mp4               filter=lfs diff=lfs merge=lfs -text<br>*.mov               filter=lfs diff=lfs merge=lfs -text<br><br>#3D Object<br>*.FBX               filter=lfs diff=lfs merge=lfs -text<br>*.fbx               filter=lfs diff=lfs merge=lfs -text<br>*.blend             filter=lfs diff=lfs merge=lfs -text<br>*.obj               filter=lfs diff=lfs merge=lfs -text<br><br>#ETC<br>*.a                 filter=lfs diff=lfs merge=lfs -text<br>*.exr               filter=lfs diff=lfs merge=lfs -text<br>*.tga               filter=lfs diff=lfs merge=lfs -text<br>*.pdf               filter=lfs diff=lfs merge=lfs -text<br>*.zip               filter=lfs diff=lfs merge=lfs -text<br>*.dll               filter=lfs diff=lfs merge=lfs -text<br>*.unitypackage      filter=lfs diff=lfs merge=lfs -text<br>*.aif               filter=lfs diff=lfs merge=lfs -text<br>*.ttf               filter=lfs diff=lfs merge=lfs -text<br>*.rns               filter=lfs diff=lfs merge=lfs -text<br>*.reason            filter=lfs diff=lfs merge=lfs -text<br>*.lxo               filter=lfs diff=lfs merge=lfs -text<br><br>*.dgml                      binary<br>[Ll]ighting[Dd]ata.asset    binary</pre><ul><li>Now, Git needs to be initialized. Type these commands in Terminal to initialize git in your project:</li></ul><pre><strong>$</strong> cd &lt;<em>your project path</em>&gt;<br><strong>$</strong> <strong>git init</strong><br>Initialized empty Git repository in &lt;<em>your project path</em>&gt;/.git/<br><strong>$</strong> <strong>git lfs install</strong><br>Updated git hooks.<br>Git LFS initialized.</pre><h4>Final question: Now what?!</h4><p>Now your unity project is ready to be developed and maintained carefully as professional game studios. If you are a beginner in Git read this article to learn the basics command of Git</p><p><a href="https://medium.com/datadriveninvestor/git-for-beginner-f438adfc3599">Git for beginner++</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d15109d9f11e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>