All you need to know about GitHub as a beginner
Tags: codenewbie, github, git, career
Published: 2020-06-25 05:09:57

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/id18s5zii19iwwkuuugc.png)
*To know what is Git and what does it do. Kindly check out the last article [What is Git, Why it is so important](https://dev.to/swastikayadav/what-is-git-why-it-is-so-important-38i2)*
Before getting into commands, there are a few terms to which you must be familiar.
<h2>Important Git Terminologies</h2>

* <b>Repository</b>
Repository or repo is nothing but the collection of source code or files or projects

* <b>Working / Current Directory</b>
The directory or folder in which you are currently working or where you have your latest code.

* <b>Branch</b>
The branch is essentially a unique set of code changes with a unique name. It has its own copy of the project history and develops on its own code.

* <b>Fork</b>
Creating a copy of a repository in your Git account to use the code or to make changes in it.

* <b>Clone</b>
The clone is an action of downloading an existing Git repository to your local computer. You will then have a local version of that Git repo in your local machine to work.

* <b>Pull Request (PR)</b></li>
Web-based way to submit your work (called “patches”) to a project. Suppose you made few changes in a project code, now you ask to pull those changes in the original project.


<h2>How to use GitHub</h2>
* <b>Git Account</b>
If you don't have an account then first make an account on any platform of your choice (I'll using GitHub here).
<img src="https://dev-to-uploads.s3.amazonaws.com/i/nzi0j27rbwdcbfnqllmt.png">

* <b>GitHub Download</b>
Make sure you download the Dekstop Github, if not click from<i><a href="https://desktop.github.com/"> here</a></i>

* <b>Creating Repositories</b>
In the Repositories section, click on <I>"New"</i> and fill the details about your Repository.
<img src="https://dev-to-uploads.s3.amazonaws.com/i/9pyqq7emp6o5bqnyeo6h.png">

* <b>Adding a project to new repo</b>
  <I>You can use the command prompt or Visual Studio Code(VS Code) 
   to add a project from your local machine to GitHub.</i>
    - If using command prompt, change into the directory where your source code is located. And for VS code, open *Terminal* there.
    - Create a new Repository and copy its URL.
    - The commands to push the source code in the repo are written below the *Quick setup*, you can have a look at the picture below.<img src="https://dev-to-uploads.s3.amazonaws.com/i/h96sdvfyo3dpbjldk1ij.png">

* <b>Pull Request</b>
  - Fork the repository to which you want to commit changes. 
  - Click on <I>Clone</i> and open the file in Dekstop GitHub (make sure you have downloaded Dekstop GitHub) 
<img src="https://dev-to-uploads.s3.amazonaws.com/i/i1fvp5i88c8vsi59bkc9.png">
  - Now, you can open the complete file in your local editor and make a new branch to commit changes.
  - Push it back to your repo by using 
    `
    $ git push -u origin new branch`
 command.
  - After pushing the commit, click on <I>Compare</i>and you will be taken to the original repo where you wanted to commit changes

  - Write the description of your changes (optional) and click on <I>Create Pull Request</I>

  - The maintainers/owners of the original repo can see your contribution and accept your request to merge with the source code.

*I hope all the basics are covered in the last two articles. If it helped, do tell me here.*

Connect with me on: [Linkedin](https://www.linkedin.com/in/swastika-yadav-12a605171/)  [Twitter](https://twitter.com/SwastikaYadav5)

Okay bye! Have a good day :)