Introduction to Git Hub:

·

4 min read

git hub.jpg

GIT HUB:

GitHub is a platform that provides hosting for software development and version control using Git.

In simpler terms ,it is a software used for hosting repositories. It is great git tool with nice UI and it’s pretty easy to use. Though, it is giving their services to open-source/public projects for free, it has some pricing for private projects.

Best thing I like about Git Hub is that it is open source which means that absolutely anyone in the tech space can contribute to open source (every role). With open-source, there is transparency, reliability, flexibility, and allows for open collaboration.

Installation of Git:

If you have already installed Git on your computer. Well and good, you can proceed to the next section.

If not, You can download it from here .

If you want some help on installation, find it here .

Set-up GitHub:

Click here to sign up on GitHub with your Email If you have one already, you can use it. Log in to your account.

No matter if you have a project already on your local machine/computer, you have to create a new repository in GitHub. Repository mean nothing but a project. Give it a nice name. Remember, it’s your first project! Name it the way you like. 😊

Create your first repository:

  1. In the upper right corner, next to your avatar or identicon, click and then select New repository.

  2. Name your repository hello-world.

  3. Write a short description.

  4. Select Initialize this repository with a README.

To create a new branch:

  1. Go to your new repository hello_world.

  2. Click the drop down at the top of the file list that says branch: main.

  3. Type a branch name, readme-edits, into the new branch text box.

  4. Select the blue Create branch box or hit “Enter” on your keyboard.

To make and commit changes :

On GitHub, saved changes are called commits. Each commit has an associated commit message, which is a description explaining why a particular change was made. Commit messages capture the history of your changes, so other contributors can understand what you’ve done and why.

  1. Make and commit changes
  2. Click the README.md file.
  3. Click the pencil icon in the upper right corner of the file view to edit. In the editor, write a bit about yourself.
  4. Write a commit message that describes your changes. Click Commit changes button.

Step 4. Open a Pull Request:

Pull Requests are the heart of collaboration on GitHub. When you open a pull request, you’re proposing your changes and requesting that someone review and pull in your contribution and merge them into their branch. Pull requests show diffs, or differences, of the content from both branches. The changes, additions, and subtractions are shown in green and red.

As soon as you make a commit, you can open a pull request and start a discussion, even before the code is finished.

By using GitHub’s system in your pull request message, you can ask for feedback from specific people or teams, whether they’re down the hall or 10 time zones away.

You can even open pull requests in your own repository and merge them yourself. It’s a great way to learn the GitHub flow before working on larger projects.

A. Click the Pull Request tab, then from the Pull Request page, click the green New pull request button.

pull request.jpg

B. In the Example Comparisons box, select the branch you made, readme-edits, to compare with main (the original).

C. Look over your changes in the diffs on the Compare page, make sure they’re what you want to submit.

c.jpg

D. When you’re satisfied that these are the changes you want to submit, click the big green Create Pull Request button.

create.jpg

E. Give your pull request a title and write a brief description of your changes.

pull.jpg

Step 5. Merge your Pull Request:

In this final step, it’s time to bring your changes together – merging your readme-edits branch into the main branch.

Click the green Merge pull request button to merge the changes into main. Click Confirm merge. Go ahead and delete the branch, since its changes have been incorporated, with the Delete branch button in the purple box.

merges.jpg

Celebrate!

via GIPHY

By completing this tutorial, you’ve learned to create a project and make a pull request on GitHub!

Here’s what you accomplished in this tutorial:

1.Created an open source repository.

2.Started and managed a new branch.

3.Changed a file and committed those changes to GitHub.

4.Opened and merged a Pull Request.