<?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: Isaac Mageto</title>
    <description>The latest articles on DEV Community by Isaac Mageto (@mokua).</description>
    <link>https://dev.to/mokua</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4071747%2F60d862a3-8450-4b2b-b774-505958e4cfc6.png</url>
      <title>DEV Community: Isaac Mageto</title>
      <link>https://dev.to/mokua</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mokua"/>
    <language>en</language>
    <item>
      <title>GIT AND GIT BASH</title>
      <dc:creator>Isaac Mageto</dc:creator>
      <pubDate>Thu, 27 Aug 2026 08:44:38 +0000</pubDate>
      <link>https://dev.to/mokua/git-and-git-bash-4260</link>
      <guid>https://dev.to/mokua/git-and-git-bash-4260</guid>
      <description>&lt;h1&gt;
  
  
  GIT AND GIT BASH
&lt;/h1&gt;

&lt;p&gt;See my first week at &lt;strong&gt;LUXDEV ACADEMY&lt;/strong&gt; has been nothing short of extraordinary.&lt;/p&gt;

&lt;p&gt;From the orientation bit – to the installation of key softwares and explanations of their workings has been just incredible.&lt;/p&gt;

&lt;p&gt;Now am into week 2 and have gotten to learn more about &lt;strong&gt;GIT and GIT BASH&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now for me I will try to break it down into a way that applies logics for simplification and understanding – so lets get into it.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. GIT
&lt;/h2&gt;

&lt;p&gt;Now Git is a software in our local computers that gets to do a bit of everything and channels communications to other key softwares in our case Git Bash (which we shall look into later) and how they get to “talk” and get your local machine upload and get you work to the public.&lt;/p&gt;

&lt;p&gt;So first lets get through some commands and what they get to do in Git Bash.&lt;/p&gt;

&lt;h2&gt;
  
  
  A – THE NAVIGATION
&lt;/h2&gt;

&lt;h3&gt;
  
  
  pwd
&lt;/h3&gt;

&lt;p&gt;This command gets you to know where you are at the current moment ie folder.&lt;/p&gt;

&lt;p&gt;So the logic is if you run &lt;code&gt;pwd&lt;/code&gt; you are telling Git Bash “where am standing at currently so that we can continue navigating through your work you need to know where you are.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;
/c/Users/isaac.mokua/OneDrive/desktop/Kenya-hospital-records-analysis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ls
&lt;/h3&gt;

&lt;p&gt;If you run this command you are basically telling Git Bash “what are the current lists am working in/with within my folder or repo&lt;/p&gt;

&lt;p&gt;then Git Bash will basically list for you the files and folders that are available.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls
&lt;/span&gt;data/  README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  mkdir
&lt;/h3&gt;

&lt;p&gt;When you want to create a new structured folder in my case for my school work I will run the “mkdir “ command – to basically tell Git “ we are creating a new working folder in our local machine that we will be working with for our assignments and class work.&lt;/p&gt;

&lt;p&gt;For example “MKDIR DATA “ we are creating a new folder named – data that we will be working on/with.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;code&gt;mkdir&lt;/code&gt; is a "quiet" command; it doesn't "speak" unless there is an error!&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;data
&lt;span class="err"&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  cd
&lt;/h3&gt;

&lt;p&gt;Change directory (CD).&lt;/p&gt;

&lt;p&gt;Remember when we had created a new folder named data – so running the “Cd “ command we are telling Git – we need to move into the folder named data _ more like opening the doors to the folder named data in our local machine and get to interact with the folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;data
isaac.mokua@CK-MOQICT-L002 MINGW64 ~/Project/data
&lt;span class="err"&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Writing contents and reading contents
&lt;/h2&gt;

&lt;p&gt;So since we are inside our folder named data we need to write the contents of the folder – basically readable contents.&lt;/p&gt;

&lt;p&gt;So we run:&lt;/p&gt;

&lt;h3&gt;
  
  
  readme.md
&lt;/h3&gt;

&lt;p&gt;This file is what we get to outline the workings of the file inside the data folder.&lt;/p&gt;

&lt;p&gt;We will be outlining what we are doing within our data project as a whole to the public so that they get to better understand what we are doing.&lt;/p&gt;

&lt;p&gt;Once ran, you will notice our readme file does not have any contents so we need to write contents.&lt;/p&gt;

&lt;p&gt;To do this we run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;README.md
&lt;span class="err"&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Echo “-“ – command
&lt;/h3&gt;

&lt;p&gt;This basically will tell Git “i want to be able to write my contents in my readme file, but one important thing to note, is inorder to structure our readme file well into a well readable file we need to use the “#” command.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Echo “#---“ – this will basically create the header for our readme file&lt;/li&gt;
&lt;li&gt;Echo “## -- “ – this command we shall be creating a subheader in our read me file.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"# Kenyan Hospital Records Analysis"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; README.md
&lt;span class="err"&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So finally once we do that and have added the contents we want the public to read as they get to interact with our works we can get to read the contents directly from terminal we use the:&lt;/p&gt;

&lt;h3&gt;
  
  
  Cat readme.md
&lt;/h3&gt;

&lt;p&gt;This command when ran – Git will basically outline for you all the written contents within your &lt;code&gt;readme.md&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;README.md
&lt;span class="c"&gt;# Kenyan Hospital Records Analysis&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now another command in Git that helps you write contents within our &lt;code&gt;readme.md&lt;/code&gt; file is the:&lt;/p&gt;

&lt;h3&gt;
  
  
  Nano readme.md
&lt;/h3&gt;

&lt;p&gt;This command will open an editable panel withn Git that you will then write your contents thus the header subheaders and subsequent contents that will lie within our readme file.&lt;/p&gt;

&lt;p&gt;So after you are done – to save use the “CTRL+O+ Enter “ to save our file, then after we are done inorder to go back to terminal use the “CTRL+X” to go back to our Git terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;nano README.md
&lt;span class="o"&gt;(&lt;/span&gt;The screen clears and opens a text editor inside your terminal&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Moving our works to Git Bash
&lt;/h2&gt;

&lt;p&gt;Then after we are done with this process its time for us to move our works to Git Bash – our main hub where all files and works we have done that we want the public to access in our repositories sit.&lt;/p&gt;

&lt;p&gt;In our case we want to move contents within our data folder to GitHub.&lt;/p&gt;

&lt;h3&gt;
  
  
  SSH Keys
&lt;/h3&gt;

&lt;p&gt;SSH – (secure shell keys) basically is a key used to connect your local PC to Git Bash – so to always avoid typing or keying in your password every now and then from terminal when working – Git offers a simple solution of a secure shell key that then becomes the safe personalised key between Git and Git Bash, so everytime you are working on anything in Git, it becomes easier to push it to your repository since Git and Git Bash have a “common key “ that is safer faster and more secure and that is able to make the 2 programs communicate and exchange “ information “ easily avoiding tiresome forms of work to a user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"********@*****.com"&lt;/span&gt;
Generating public/private ed25519 key pair.
Enter file &lt;span class="k"&gt;in &lt;/span&gt;which to save the key &lt;span class="o"&gt;(&lt;/span&gt;/c/Users/isaac.mokua/.ssh/id_ed25519&lt;span class="o"&gt;)&lt;/span&gt;: 
Your identification has been saved &lt;span class="k"&gt;in&lt;/span&gt; /c/Users/isaac.mokua/.ssh/id_ed25519
Your public key has been saved &lt;span class="k"&gt;in&lt;/span&gt; /c/Users/isaac.mokua/.ssh/id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Git tracking our works
&lt;/h2&gt;

&lt;p&gt;First we need Git to take charge of the works inside our Git terminal ( the ones we have had the readme file and data file” – the logic here is Git is able to track and take charge of our files, incase of anything we are able to edit or do any other checks etc to our file, as well as Git will get to know the distinctive features and works inside our data.&lt;/p&gt;

&lt;p&gt;Remember all works are unique so Git will be able to even “know about each and offers flexibility, so we can work an other stuff as well without loosing track or works we were doing. Running this command Git automatically add the “.git” that will basically record any changes that user makes going forward.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git init
Initialized empty Git repository &lt;span class="k"&gt;in&lt;/span&gt; /c/Users/isaac.mokua/Project/.git/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Git status
&lt;/h3&gt;

&lt;p&gt;This command is to basically run the status or basically “where are we currently “ within our folder and the works we are conducting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git status
On branch main
Untracked files:
  &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="s2"&gt;"git add &amp;lt;file&amp;gt;..."&lt;/span&gt; to include &lt;span class="k"&gt;in &lt;/span&gt;what will be committed&lt;span class="o"&gt;)&lt;/span&gt;
    README.md
    data/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Git add .
&lt;/h3&gt;

&lt;p&gt;This command basically is like pushing our data folder in line – to be “ready “ to go public within Git Bash but most important thing yet to know it has not been moved its just static ready to “launch “.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;span class="err"&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Connecting to the repository
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add origin &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;paste &lt;/span&gt;your ssh git bash key&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember the logic of Git offering flexibility when working and making changes to your folder/data or works, this command in Git offers that – so basically the logic is you are telling Git “always make changes to this repository that am pointing you to “ since all changes and works are unique and to avoid any mixup when needing to changes on particulars of your pushed code/works to Git Bash – so Git knows what specifically to check and target/make changes to.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git remote add origin git@github.com:MOKUA122/Kenya-hospital-records-analysis.git
&lt;span class="err"&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. Launching our works
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Commit (Taking the Snapshot)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Initial commit: Added data and README"&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;main &lt;span class="o"&gt;(&lt;/span&gt;root-commit&lt;span class="o"&gt;)&lt;/span&gt; 7a2b3c4] Initial commit: Added data and README
 2 files changed, 15 insertions&lt;span class="o"&gt;(&lt;/span&gt;+&lt;span class="o"&gt;)&lt;/span&gt;
 create mode 100644 README.md
 create mode 100644 data/Kenyan_Hospital_Health_Records.xlsx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Push (The Launch)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin main
Enumerating objects: 5, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
Counting objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;5/5&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
Writing objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;5/5&lt;span class="o"&gt;)&lt;/span&gt;, 450 bytes | 450.00 KiB/s, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
Total 5 &lt;span class="o"&gt;(&lt;/span&gt;delta 0&lt;span class="o"&gt;)&lt;/span&gt;, reused 0, pack-reused 0
To github.com:MOKUA122/Kenya-hospital-records-analysis.git
 &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;new branch]      main -&amp;gt; main
branch &lt;span class="s1"&gt;'main'&lt;/span&gt; &lt;span class="nb"&gt;set &lt;/span&gt;up to track &lt;span class="s1"&gt;'origin/main'&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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