<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Johan G</title>
    <description>The latest articles on DEV Community by Johan G (@jgunawancode).</description>
    <link>https://dev.to/jgunawancode</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F857906%2F313da02a-9dac-44b0-989e-6619dba26a8e.jpg</url>
      <title>DEV Community: Johan G</title>
      <link>https://dev.to/jgunawancode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jgunawancode"/>
    <language>en</language>
    <item>
      <title>Git: Amending Commits</title>
      <dc:creator>Johan G</dc:creator>
      <pubDate>Mon, 30 May 2022 15:12:42 +0000</pubDate>
      <link>https://dev.to/jgunawancode/git-amending-commits-466b</link>
      <guid>https://dev.to/jgunawancode/git-amending-commits-466b</guid>
      <description>&lt;p&gt;There are times after making a commit then reality hits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Forgot one or more files to be included in the commit&lt;/li&gt;
&lt;li&gt;Commit message looks silly, unclear, unprofessional,etc. Whatever the reason is, it needs to be edited.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of making a brand new separate commit, the previous commit can be "redo" using&lt;br&gt;
&lt;code&gt;git commit --amend&lt;/code&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Change Git default branch name</title>
      <dc:creator>Johan G</dc:creator>
      <pubDate>Mon, 30 May 2022 13:34:38 +0000</pubDate>
      <link>https://dev.to/jgunawancode/change-git-default-branch-name-523l</link>
      <guid>https://dev.to/jgunawancode/change-git-default-branch-name-523l</guid>
      <description>&lt;p&gt;Prior to Git 2.28, the default branch name when &lt;code&gt;git init&lt;/code&gt; is used is &lt;code&gt;master&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;To change the default branch name use the command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git config --global init.defaultBranch [new default name]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;More details, can be found &lt;a href="https://github.blog/2020-07-27-highlights-from-git-2-28/#introducing-init-defaultbranch"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>git</category>
    </item>
    <item>
      <title>Git: Commit (and ignore files from commit)</title>
      <dc:creator>Johan G</dc:creator>
      <pubDate>Wed, 11 May 2022 04:57:16 +0000</pubDate>
      <link>https://dev.to/jgunawancode/git-commit-4bm</link>
      <guid>https://dev.to/jgunawancode/git-commit-4bm</guid>
      <description>&lt;h2&gt;
  
  
  The Basic Git Commit Workflow
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Make Changes&lt;/li&gt;
&lt;li&gt;Add Changes&lt;/li&gt;
&lt;li&gt;Commit&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  1. Make Changes
&lt;/h2&gt;

&lt;p&gt;Make new files, edit files, delete files, etc. in a  location that is tracked by Git.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Add Changes
&lt;/h2&gt;

&lt;p&gt;Group specific changes together, in preparation of committing. &lt;u&gt;The changes added in this step are not committed yet to the repo&lt;/u&gt;. Consider this step as a Staging step/area.&lt;br&gt;
&lt;code&gt;git add [file1] [file2]&lt;/code&gt;&lt;br&gt;
&lt;em&gt;Explicitly add the files to be added.&lt;/em&gt;&lt;br&gt;
&lt;code&gt;git add .&lt;/code&gt;&lt;br&gt;
&lt;em&gt;Stage ALL changes at once.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Commit
&lt;/h2&gt;

&lt;p&gt;Commit everything that was previously added.&lt;br&gt;
&lt;code&gt;git commit -m "Describe the commit here"&lt;/code&gt;&lt;br&gt;
&lt;em&gt;The &lt;code&gt;-m&lt;/code&gt; flag is to pass an inline commit message. Without this flag, a text editor will be launched to give a commit message.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Ignoring Files
&lt;/h2&gt;

&lt;p&gt;There are some files that should not be committed such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Temporary files, build results, and files generated by an IDE&lt;/li&gt;
&lt;li&gt;Secrets, API keys, credentials, etc.&lt;/li&gt;
&lt;li&gt;Log files&lt;/li&gt;
&lt;li&gt;Dependencies &amp;amp; packages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To ignore those files create &lt;strong&gt;.gitignore&lt;/strong&gt; file in the root of a repo. Inside the file, write patterns to tell git which files &amp;amp; folders to ignore.&lt;/p&gt;

&lt;p&gt;See &lt;a href="https://github.com/github/gitignore/blob/main/VisualStudio.gitignore"&gt;this example&lt;/a&gt; of ignoring files generated by Visual Studio.&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Git: Create a repo</title>
      <dc:creator>Johan G</dc:creator>
      <pubDate>Fri, 06 May 2022 10:27:57 +0000</pubDate>
      <link>https://dev.to/jgunawancode/git-create-a-repo-25m5</link>
      <guid>https://dev.to/jgunawancode/git-create-a-repo-25m5</guid>
      <description>&lt;p&gt;&lt;strong&gt;Git Repository&lt;/strong&gt;&lt;br&gt;
A Git Repository, commonly referred to as a "Repo", is a container that tracks and manages files withing a folder.&lt;/p&gt;

&lt;p&gt;Anytime we want to use git to track our project, we need to create a new git repository.&lt;/p&gt;

&lt;p&gt;We can create as many repos as we want on our machine. Each repo has its own histories and contents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a new Git Repo&lt;/strong&gt;&lt;br&gt;
To create a new git repository, execute the command below from the top-level folder containing the project&lt;br&gt;
&lt;code&gt;git init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional Notes&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Git tracks a directory and all nested subdirectories.&lt;/li&gt;
&lt;li&gt;Because of point #1, do not execute &lt;code&gt;git init&lt;/code&gt; inside of an existing repo

&lt;ul&gt;
&lt;li&gt;Execute &lt;code&gt;git status&lt;/code&gt; to verify that you are not inside of an existing repo.

&lt;ul&gt;
&lt;li&gt;If you get &lt;code&gt;fatal: not a git repository or any of the parent directories: .git&lt;/code&gt;, then you're not inside of an existing repo.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>git</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Configure Git with name and email</title>
      <dc:creator>Johan G</dc:creator>
      <pubDate>Thu, 05 May 2022 06:16:05 +0000</pubDate>
      <link>https://dev.to/jgunawancode/configure-git-with-name-and-email-d1b</link>
      <guid>https://dev.to/jgunawancode/configure-git-with-name-and-email-d1b</guid>
      <description>&lt;p&gt;To check if Git is configured with your username&lt;br&gt;
&lt;code&gt;git config user.name&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To check if Git is configured with your email address&lt;br&gt;
&lt;code&gt;git config user.email&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To configure the name that Git will associate with your work&lt;br&gt;
&lt;code&gt;git config --global user.name "Your Name"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To configure the email address in Git&lt;br&gt;
&lt;code&gt;git config --global user.email abc@test.com&lt;/code&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Install Git on a Windows Machine</title>
      <dc:creator>Johan G</dc:creator>
      <pubDate>Thu, 05 May 2022 05:42:50 +0000</pubDate>
      <link>https://dev.to/jgunawancode/install-git-on-a-windows-machine-1l2e</link>
      <guid>https://dev.to/jgunawancode/install-git-on-a-windows-machine-1l2e</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Download and install Git for Windows 

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://git-scm.com/download/win"&gt;https://git-scm.com/download/win&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Select "Launch Git Bash" on the last step of the Installation&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;On Git Bash, execute &lt;code&gt;git --version&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;This is to confirm that Git is successfully installed&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note on Git Bash:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Git was designed to run on a Unix-based interface (like Bash)&lt;/li&gt;
&lt;li&gt;Windows comes with different command line interface called Command Prompt that is not Unix-based&lt;/li&gt;
&lt;li&gt;Git Bash is a tool that emulates a Bash experience on a Windows machine&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>git</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
