<?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: Kunal Verma</title>
    <description>The latest articles on Forem by Kunal Verma (@kverma_dev).</description>
    <link>https://forem.com/kverma_dev</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%2F584352%2F4709c5ce-caa1-4cd1-9620-0c40e4d4f7a5.jpeg</url>
      <title>Forem: Kunal Verma</title>
      <link>https://forem.com/kverma_dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kverma_dev"/>
    <language>en</language>
    <item>
      <title>Learn to Push Your Code To GitHub</title>
      <dc:creator>Kunal Verma</dc:creator>
      <pubDate>Fri, 26 Mar 2021 18:43:24 +0000</pubDate>
      <link>https://forem.com/kverma_dev/learn-to-push-your-code-to-github-3m3o</link>
      <guid>https://forem.com/kverma_dev/learn-to-push-your-code-to-github-3m3o</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;We have all heard of &lt;strong&gt;&lt;a href="https://github.com" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/strong&gt;, right?&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;beautiful UI&lt;/strong&gt;, the development environment created by all those &lt;strong&gt;ongoing&lt;/strong&gt; projects and their &lt;strong&gt;huge&lt;/strong&gt; codebases, makes GitHub one of a kind platform for &lt;strong&gt;collaboration&lt;/strong&gt; and to &lt;strong&gt;share&lt;/strong&gt; your ideas with the world.&lt;br&gt;
It has now become an essential part in a developer's life and especially in times like these where &lt;br&gt;
'&lt;strong&gt;Work from Home&lt;/strong&gt;' is now becoming the 'New Normal'.&lt;/p&gt;

&lt;p&gt;But, sometimes these all can become a little overwhelming for young developers, who are just starting their journey and stepping into the world of &lt;strong&gt;Open Source Software Development&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;One of the common areas, where beginners get stuck is &lt;strong&gt;uploading&lt;/strong&gt; their written code files to GitHub!&lt;br&gt;
Derived the &lt;strong&gt;logic&lt;/strong&gt;, written some &lt;strong&gt;code&lt;/strong&gt;, and the project is &lt;strong&gt;ready&lt;/strong&gt; to be uploaded. But then the question arises &lt;br&gt;
'&lt;strong&gt;How exactly am I supposed to push/upload these files to my  repository?&lt;/strong&gt;'🧐&lt;/p&gt;

&lt;p&gt;I've got you covered there! &lt;br&gt;
In this article we'll be covering the &lt;strong&gt;simple&lt;/strong&gt; and &lt;strong&gt;step-by-step&lt;/strong&gt; process of pushing your code files to your GitHub repository without any hassle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's jump right into it!&lt;/strong&gt;⚡️&lt;/p&gt;

&lt;h2&gt;
  
  
  The Way To Go
&lt;/h2&gt;

&lt;p&gt;Alright, so for handling these processes and working with files, we use what is called as '&lt;strong&gt;Git&lt;/strong&gt;'.&lt;br&gt;
It is &lt;strong&gt;version control system&lt;/strong&gt;, which basically designed to handle everything from small to very large projects with &lt;strong&gt;speed&lt;/strong&gt; and &lt;strong&gt;efficiency&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For pushing the files to GitHub, learning the &lt;strong&gt;Git commands&lt;/strong&gt; and using the &lt;br&gt;
&lt;strong&gt;terminal/command&lt;/strong&gt; 👾  line for the task is a more efficient way rather than the traditional way of doing things using &lt;strong&gt;GUI&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step-By-Step Guide
&lt;/h2&gt;

&lt;p&gt;Follow this &lt;strong&gt;guide&lt;/strong&gt; and &lt;strong&gt;tick the checkbox&lt;/strong&gt; once you complete each step. At the end, you'll achieve what you were looking for!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating a new repository on GitHub&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] To do that, click on the &lt;strong&gt;&lt;code&gt;+&lt;/code&gt;&lt;/strong&gt; sign besides the profile picture on the GitHub page&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FMge9sr0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FMge9sr0.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Select '&lt;strong&gt;new repository&lt;/strong&gt;'&lt;/li&gt;
&lt;li&gt;[ ] Give your repository a name. For this example, lets go with "&lt;strong&gt;Practice&lt;/strong&gt;"&lt;/li&gt;
&lt;li&gt;[ ] Click on '&lt;strong&gt;create repository&lt;/strong&gt;'&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After this, a new page with some information would appear.&lt;br&gt;
This we'll be using further ahead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Navigating to your project folder and setting it as your current working directory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Using the command line, set your project folder as your &lt;strong&gt;current working directory&lt;/strong&gt; as follow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] use the &lt;code&gt;ls&lt;/code&gt; command which lists down all the files and folder in the current directory.&lt;/li&gt;
&lt;li&gt;[ ] Once you find your project folder, use the &lt;code&gt;cd&lt;/code&gt; command to &lt;strong&gt;change the directory&lt;/strong&gt; and set this as current working directory.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2Fuj92Hab.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2Fuj92Hab.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, the project folder has become current working directory and we can start using the &lt;strong&gt;Git commands&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Initialise the directory as a Git repository&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Basically in this step, we are &lt;strong&gt;activating/creating&lt;/strong&gt; a Git environment in our folder, in order to use the commands. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] using the command &lt;code&gt;git init&lt;/code&gt; in the command line, the Git repository is &lt;strong&gt;initialised&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FEzcJ35u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FEzcJ35u.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adding your files to the Git Repository&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, the aim is to move all our files to this repository. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] use the command &lt;code&gt;git add .&lt;/code&gt; , which will add all the files to the &lt;strong&gt;Git repo&lt;/strong&gt; that we created&lt;/li&gt;
&lt;li&gt;[ ] if you want to check whether the files have been added successfully, we use a command &lt;code&gt;git status&lt;/code&gt; .&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This will display all the added files in &lt;strong&gt;green colour&lt;/strong&gt; if the process is carried out successfully.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FQGESZUT.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FQGESZUT.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Commit the files in the repository&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Commit&lt;/strong&gt; means to &lt;strong&gt;save the changes&lt;/strong&gt; to the local repository.&lt;br&gt;
This is an important process when it comes to saving your progress along the way, when using Git.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] run the command &lt;code&gt;git commit -m "-message-"&lt;/code&gt; in order to save the changes that was done to the Git repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Adding the URL of your remote repository&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;By remote repository, means the repository that we have created on the &lt;strong&gt;GitHub account&lt;/strong&gt;.&lt;br&gt;
Here, the aim is to add the link for the GitHub repository where we have push our files to. &lt;br&gt;
(&lt;strong&gt;the link is available on the repo page on GitHub&lt;/strong&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FLP0Wu6n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FLP0Wu6n.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] using the command &lt;code&gt;git remote add origin (URL)&lt;/code&gt;, we are adding the remote repository with the given URL.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F1Qcgirt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F1Qcgirt.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pushing your code files&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This the last step where we will be running a command to push all our files to the remote repository from the &lt;strong&gt;local&lt;/strong&gt; Git repository.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] use the command &lt;code&gt;git push -u origin master&lt;/code&gt;, this will push all your files from your &lt;strong&gt;local repository&lt;/strong&gt; to the master branch of the GitHub repository created.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Yay! There you have all your precious code files in your GitHub, safe &amp;amp; sound.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Please share your &lt;strong&gt;valuable feedback&lt;/strong&gt; on this article in the comment section below and can also &lt;strong&gt;suggest&lt;/strong&gt; some changes for future topics as well!😇&lt;/p&gt;

</description>
      <category>github</category>
      <category>opensource</category>
      <category>git</category>
    </item>
  </channel>
</rss>
