<?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>Forem: Francisco Correia</title>
    <description>The latest articles on Forem by Francisco Correia (@fcorreia18).</description>
    <link>https://forem.com/fcorreia18</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%2F1041955%2Fd090166b-bde4-42cb-8314-440eb0b65c9c.jpeg</url>
      <title>Forem: Francisco Correia</title>
      <link>https://forem.com/fcorreia18</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/fcorreia18"/>
    <language>en</language>
    <item>
      <title>Git + GitHub beginners friendly</title>
      <dc:creator>Francisco Correia</dc:creator>
      <pubDate>Wed, 15 Mar 2023 10:04:30 +0000</pubDate>
      <link>https://forem.com/fcorreia18/git-github-beginners-friendly-766</link>
      <guid>https://forem.com/fcorreia18/git-github-beginners-friendly-766</guid>
      <description>&lt;p&gt;If you're a beginner developer, you might think that these two terms mean the same thing – but they're different.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So lets have quick aside before we start:&lt;/strong&gt; &lt;em&gt;Git&lt;/em&gt; and &lt;em&gt;Github&lt;/em&gt; are not the same thing. Git is a free and open-source, version control system designed for working on the Linux operating system; GitHub is a company that makes tools which integrate with git in other terms github uses Git underneath, and lets you manage your Git repositories or folders easily on its platform. You do not need GitHub to use git, but you cannot use GitHub without using git. There are many other alternatives to GitHub, such as GitLab, BitBucket.&lt;br&gt;
Now that we know the difference, lets get right into.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In order to follow along with me, you'll need:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A command line interface.&lt;/li&gt;
&lt;li&gt;A text editor.&lt;/li&gt;
&lt;li&gt;A GitHub account.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;How to install Git&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In order to use Git, you have to install it on your computer. To do this, you can download the latest version on the &lt;a href="https://git-scm.com/downloads"&gt;official website&lt;/a&gt;. You can download for your operating system from the options given.&lt;/p&gt;

&lt;p&gt;Follow the necessary installer guide until installation is complete. Open the command prompt and type &lt;code&gt;git version&lt;/code&gt; to verify that Git was successfully installed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create a GitHub account&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The next thing you'll need to do is to create an account, you can do this &lt;a href="https://github.com"&gt;here&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Now with your terminal opened, configure your username and email address. Git will use this information to identify who made specific changes to files.&lt;/p&gt;

&lt;p&gt;To set your username, type and execute these commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.name "YOUR_USERNAME"
git config --global user.email "YOUR_EMAIL"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just make sure to replace "YOUR_USERNAME" and "YOUR_EMAIL"  with your personal data.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Set up the project&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At your terminal move to where you want to place the project on your local machine using the cd (change directory) command. For example, i've created a folder named &lt;strong&gt;git-github&lt;/strong&gt; and changed to it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;h6&gt;
  
  
  &lt;strong&gt;Quick note:&lt;/strong&gt; the commands of the next two sections may change according your operation system and the terminal you're using, i recomend to take a look at the documentation of the terminal.
&lt;/h6&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UyYIzRlL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9rpnf1989haip0enovxv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UyYIzRlL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9rpnf1989haip0enovxv.png" alt="Created the folder wich contains the project files" width="580" height="244"&gt;&lt;/a&gt;&lt;br&gt;
Now to initialize a git repository in the root of the folder, run the &lt;code&gt;git init&lt;/code&gt; command: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ypC71sfI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x0qp80l7xxscq5mjbgow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ypC71sfI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x0qp80l7xxscq5mjbgow.png" alt="Initialized a git repository" width="580" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Add a new file to your local repository&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add a new file to the project,by running a touch command. &lt;code&gt;touch tasks.txt&lt;/code&gt; this command will create and save a blank file named tasks.txt. &lt;/p&gt;

&lt;p&gt;After creating the new file, you can use the &lt;code&gt;git status&lt;/code&gt; command to see which files git knows exist.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gQ1BX6-g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qxqkbfr72phv3ayc37ul.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gQ1BX6-g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qxqkbfr72phv3ayc37ul.png" alt="checkig the status of the files" width="577" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Git is basically saying: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;we noticed you created a new file called &lt;strong&gt;tasks.txt&lt;/strong&gt;, but unless you use the &lt;code&gt;git add&lt;/code&gt; command we can't  do anything with it."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now lets add into the staging area so git can track our file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LHOnClK1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jbjxayjezasppk5gg4ai.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LHOnClK1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jbjxayjezasppk5gg4ai.png" alt="adding the file into tracking/staging area" width="580" height="365"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you notice i have used the 3 following commands: &lt;br&gt;
 &lt;code&gt;echo "git-github beginner friendly" &amp;gt;&amp;gt; tasks.txt&lt;/code&gt; to write inside my file.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add tasks.txt&lt;/code&gt; that actually put the file in the staging area.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git status&lt;/code&gt; shows the files we have and their current state. And now, we can see that we have a different information, "git is now tracking tasks.txt".&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Commit files in Git&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The next state for a file after the staged state is the committed state. To commit our file, we use the &lt;code&gt;git commit -m "message of commit"&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;The message at the end of the commit should be something related to what changes you made - maybe it's a new feature, maybe it's a bug fix. A clear explanation of your changes can be extremely helpful for future programmers who are trying to figure out why some changes was made looking at your  code years later.&lt;/p&gt;

&lt;p&gt;The command &lt;code&gt;git commit&lt;/code&gt;  records the modification of all files. The second part &lt;code&gt;-m "first commit"&lt;/code&gt; is the commit message. &lt;code&gt;-m&lt;/code&gt; is shorthand for &lt;em&gt;message&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;After executing this command, you should get something similar to this: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Gq4hFMZP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m9g8y9t2xjhp5v2ca1x6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Gq4hFMZP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m9g8y9t2xjhp5v2ca1x6.png" alt="Commiting a file" width="580" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now our file is in the committed state.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lets create a Github repository&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gd0A01bF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m9q61wc5l19k8na2o5ra.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gd0A01bF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m9q61wc5l19k8na2o5ra.png" alt="github create new repository page" width="880" height="736"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you press &lt;strong&gt;Create repository&lt;/strong&gt; github will make your new repository. And then you're gonna be redirected to a page that tells you how to create a new repository from scratch or if you want to push a repository you have created locally.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SeRWhaBH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wcnll01x1uvvjh2w1wdh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SeRWhaBH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wcnll01x1uvvjh2w1wdh.png" alt="github new repository image" width="880" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;since we've already created a new repo locally, we will use commands in the &lt;em&gt;"…or push an existing repository from the command line"&lt;/em&gt; section. These are the commands:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git remote add origin https://github.com/fcorreia18/git-github.git&lt;br&gt;
git branch -M main&lt;br&gt;
git push -u origin main&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5_oFL41B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vbrug98m37e5r26gzixl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5_oFL41B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vbrug98m37e5r26gzixl.png" alt="push a local repository to github" width="578" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The first command creates a connection between your local repo and the remote repo on Github.&lt;/li&gt;
&lt;li&gt;The second command changes your main branch's and name it to "main". acording your git version The default branch might be created as "master", but "main" is the standard name for repositories now.&lt;/li&gt;
&lt;li&gt;The last command pushes your local repository to GitHub.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Git Branches&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Git recommend us to work with branches: because it allows you to create a copy of a file you would like to work on without messing up the original copy. You can either merge these changes later to the original copy or just let the branch remain independent.for example, if you want to work on a project feature, create a feature branch using &lt;code&gt;git checkout&lt;/code&gt; or &lt;code&gt;git branch&lt;/code&gt;. Make changes the changes in your files(the actual feature) and when you have done, merge the branch with the base or just create a pull request inside your github repository. &lt;br&gt;
Here's an example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IlsP-n-v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9r83tltm3fsjzxgxdsyl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IlsP-n-v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9r83tltm3fsjzxgxdsyl.png" alt="Creating a new branch" width="581" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git checkout -b feature&lt;/code&gt; In our case, we have created and switched to a new branch called &lt;code&gt;feature&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G0lI9TvX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wowf70go0z117jvrchp8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G0lI9TvX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wowf70go0z117jvrchp8.png" alt="change inside the files in a new branch" width="581" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo&lt;/code&gt; to write inside the file&lt;br&gt;
&lt;code&gt;cat&lt;/code&gt; to view the changes we made&lt;br&gt;
&lt;code&gt;git add tasks.txt&lt;/code&gt; to stage our changes&lt;br&gt;
&lt;code&gt;git status&lt;/code&gt; to check the status of our file, we can see that git notice that we've changed something.&lt;/p&gt;

&lt;p&gt;Now we just need to commit it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ifMkChaG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uayvbdm74lsqzy0trigt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ifMkChaG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uayvbdm74lsqzy0trigt.png" alt="commit in a new branch" width="581" height="248"&gt;&lt;/a&gt;&lt;br&gt;
Now that we commit our changes we need to send it to the remote repository, but the remote repo doesn't have a &lt;em&gt;feature&lt;/em&gt; branch. To create a new branch and push changes, we can use &lt;code&gt;git push origin feature:feature&lt;/code&gt; or &lt;code&gt;git push -u origin feature&lt;/code&gt;. The output of the command shows that a new branch have been created and both local and remote &lt;code&gt;feature&lt;/code&gt; branches are synced. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PDu6sexy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1hpvt2u27hsp0f68smzc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PDu6sexy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1hpvt2u27hsp0f68smzc.png" alt="push the new branch to remote repository" width="580" height="286"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looking at the output you can observe that we have successfully pushed the local branch to GitHub with a modified version of our tasks.txt file. &lt;br&gt;
Git also says to create a pull request inside of our github repository, but in order to learn how pull requests work we gonna do this manually by merging the main branch with the feature.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Merging Branches&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before we merge the branchs i just want to show you the current stage of our files in the main branch&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DfvoTdYF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgocavkmetofxxdmgdfi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DfvoTdYF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgocavkmetofxxdmgdfi.png" alt="checkout the files stage inside main branch" width="582" height="213"&gt;&lt;/a&gt;&lt;br&gt;
Did you notice that the changes we made did not afect the file inside of the main branch? this is one of the greatest features of git it allows us to have multi stages of our files in different branchs and even at the same branch we can &lt;code&gt;checkout&lt;/code&gt; different versions of the file &lt;em&gt;just giving you a spoiler&lt;/em&gt;😁🤭&lt;/p&gt;

&lt;p&gt;Now we can merge the changes we made in the &lt;code&gt;feature&lt;/code&gt; branch into the main branch by running &lt;code&gt;git merge feature&lt;/code&gt;. At this point, you will see all the changes made in the &lt;code&gt;feature&lt;/code&gt; branch reflected on the main branch. You should also have an output similar to this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---P4HQ6Qq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q7l0l4tplx4a84f6slp5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---P4HQ6Qq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q7l0l4tplx4a84f6slp5.png" alt="merging branchs" width="580" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Commands
&lt;/h2&gt;

&lt;p&gt;Before we finish i just want to give some basic commands that you probably gonna use often. The basic commands include initializing the Git repository, saving changes,review files, checking logs, pushing the changes to the remote repository, merging, etc.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git config&lt;/code&gt; use to set user specific configurations such as email, username, and file format.&lt;br&gt;
&lt;code&gt;git init&lt;/code&gt; create a Git repository in a local directory.&lt;br&gt;
&lt;code&gt;git clone&lt;/code&gt; : copy the entire repository from a remote server to remote directory. You can also use it to copy local repositories.&lt;br&gt;
&lt;code&gt;git add&lt;/code&gt; : add a single file and folder to the staging area. While &lt;code&gt;git add .&lt;/code&gt; lets you add all files in the present folder.&lt;br&gt;
&lt;code&gt;git commit –m “message”&lt;/code&gt;: &lt;em&gt;-m&lt;/em&gt; stand for message followed by the actual message, will create a snapshot of changes and save it in the repository.&lt;br&gt;&lt;br&gt;
&lt;code&gt;git status&lt;/code&gt; shows the list of changed files or files that have yet to be staged and committed.&lt;br&gt;&lt;br&gt;
&lt;code&gt;git push -u &amp;lt;remote-name&amp;gt; &amp;lt;branch-name&amp;gt;&lt;/code&gt;: send local commits to remote branch of repository, the -u flag creates a tracking reference for the branch.&lt;br&gt;&lt;br&gt;
&lt;code&gt;git checkout -b &amp;lt;branch-name&amp;gt;&lt;/code&gt;: creates a new branch and switches to a new branch, if you dont want to switch just use &lt;code&gt;git branch &amp;lt;branch-name&amp;gt;&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;git remote –v&lt;/code&gt;: view all remote repositories.&lt;br&gt;
&lt;code&gt;git remote add&lt;/code&gt; [-t ] : connects the local folder to the repository on GitHub.&lt;br&gt;
&lt;code&gt;git branch –d&lt;/code&gt; : delete the branch.&lt;br&gt;
&lt;code&gt;git pull&lt;/code&gt; pull the history commits to a local repository from a remote repository. &lt;br&gt;
&lt;code&gt;git merge &amp;lt;branch-name&amp;gt;&lt;/code&gt;: after resolving merge conflicts(if you have) the command blends selected branch into the current branch.&lt;br&gt;
&lt;code&gt;git log&lt;/code&gt; shows a detailed list of commits for the current branch(We didnt use it, why dont you try it by yourself as a homework?).&lt;/p&gt;

&lt;p&gt;Those are some of the main commands that'll help get you started using Git and you'll use all the time. if you find hard to use it just stick at this article, feel free to take a look as many time you need. Just remember &lt;em&gt;&lt;strong&gt;pratice makes improvement&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
The more you continue using Git and GitHub, the more comfortable you'll get using these commands. it will eventually get easier as you build small projects and host them on GitHub using Git.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CONGRATULATIONS&lt;/strong&gt;&lt;br&gt;
I'm glad you've done so far 💯, in this article, we have learned about Git and GitHub and why they are so important. The tutorial also introduces you to basic Git commands and provides hands-on experience on how to track changes in your files and code. If you are interested in learning more about Git, here are some resources:&lt;br&gt;
&lt;a href="https://git-scm.com/doc"&gt;Git Official Documentation&lt;/a&gt;&lt;br&gt;
&lt;a href="https://docs.github.com/get-started/quickstart/hello-world"&gt;Introduction to Github&lt;/a&gt; &lt;br&gt;
&lt;a href="https://learngitbranching.js.org"&gt;Git Playground&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.w3schools.com/git"&gt;w3 schools Git Basics&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.freecodecamp.org"&gt;Free Code Camp Introdution to Git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you like this article consider to subscribe and follow me in my social mideas:  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/francisco-correia-2393411a4/"&gt;LINKEDIN&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com"&gt;GITHUB&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy coding!💻&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>programming</category>
      <category>fcorreia18</category>
    </item>
  </channel>
</rss>
