How to use Github? Step-by-Step Guide

To sign up on GitHub, here are six steps

Step 1: Sign up for GitHub

  1. Visit their website and click on the Signup button.
  2. Fill in the information, including your username, email, and password.
  3. Once completed, verify your email, and you’ll have a free GitHub account to use for code repositories and collaboration.
https://docs.github.com/en/get-started/quickstart/hello-world

Step 2: Create a Repository on GitHub

Create a Repository on GitHub

To create a GitHub repository for your project, follow these simple steps:

1. Go to the upper-right corner of any GitHub page and click on the “+” sign, then select “New repository.”

2. In the “Repository name” box, give your repository a name.

3. Add a short description in the “Description” box.

4. Choose whether your repository will be Public or Private.

5. Check the option that says “Add a README file.”

6. Click on the “Create repository” button.

This repository can be used to organize and store files, collaborate with others, and showcase your project on GitHub.

https://docs.github.com/en/get-started/quickstart/hello-world

Step 3: Create a branch

To create a new branch in GitHub, follow these simple steps:

1. Go to your repository on GitHub.

2. Click on the “Code” tab.

3. Above the file list, find the dropdown menu that currently says “main.”

4. Type a new branch name, for example, “readme-edits,” into the text box.

5. Click on the “Create branch: readme-edits from main” button.

This allows you to work on different versions of your project simultaneously. Later, you can make changes on this branch and merge it back into the main branch when ready.

https://docs.github.com/en/get-started/quickstart/hello-world

Step 4: Making and Committing Changes

To make and save changes to your project on GitHub, follow these steps:

1. Under the branch you created (like “readme-edits”), click on the file you want to edit (e.g., README.md).

2. Click the pencil icon in the upper right to enter the editor.

3. Write your changes using different Markdown elements to format the text.

4. Click “Commit changes” at the bottom of the page.

5. In the “Commit changes” box, write a brief message explaining what you changed.

6. Click “Commit changes” again.

These changes will be saved in the branch you’re working on (e.g., readme-edits) and won’t affect the main branch. Each set of changes is called a commit, and the commit messages help track and understand the history of your project.

Step 5: Open a Pull Request

A pull request is how you propose and merge changes from one branch into another on GitHub. Here’s how you do it:

1. Go to the “Pull requests” tab in your repository on GitHub.

2. Click on the “New pull request” button.

3. In the “Example Comparisons” box, select the branch you made (e.g., readme-edits) to compare with the main branch.

4. Review the changes in the comparison to make sure they’re what you want.

5. Click “Create pull request.”

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

7. Optionally, add reviewers, assignees, labels, projects, or milestones to your pull request.

8. Click “Create pull request” again.

Your proposed changes are visible now, and collaborators can review, discuss, and suggest further edits before merging them into the main project.

https://docs.github.com/en/get-started/quickstart/hello-world

Step 6: Merge your Pull Request

Merging a pull request is like adding your changes from a separate branch into the main project. Here’s how you can do it:

1. Go to the bottom of your pull request on GitHub.

2. Click on the “Merge pull request” button.

3. Select “Confirm merge.”

4. Click on “Delete branch” to remove the branch you merged.

5. You’ll see a message confirming the successful merge.

This process brings your changes from the branch into the main branch of the project. If there were any conflicts between the code, GitHub would notify you to resolve them before merging. After merging, you can safely delete the branch, and if you have more changes, you can create a new branch and repeat the process.

https://docs.github.com/en/get-started/quickstart/hello-world

References

Manya Goyal is an AI and Research consulting intern at MarktechPost. She is currently pursuing her B.Tech from the Guru Gobind Singh Indraprastha University(Bhagwan Parshuram Institute of Technology). She is a Data Science enthusiast and has a keen interest in the scope of application of artificial intelligence in various fields. She is a podcaster on Spotify and is passionate about exploring.

­čÉŁ Join the Fastest Growing AI Research Newsletter Read by Researchers from Google + NVIDIA + Meta + Stanford + MIT + Microsoft and many others...