GitHub 101: How to Use GitHub Like a Pro

By
Timan Wainaina
July 20, 2023
min read
Updated
December 10, 2024
Photo credit
Use GitHub like a pro with our step-by-step guide, FAQs and best practices. Learn how to use GitHub, create your first repository and start collaborating.
Generate Free AI Documents!


Introduction

If you're a new software developer, you've probably heard people discussing how to use GitHub or Git. You might be asking yourself:

GitHub is the world's largest host of source code. There are now over 100 million developers around the world using GitHub.

This blog will give you a practical guide on how to use GitHub, answer GitHub FAQs and provide tips on how to use GitHub effectively.   

How to use GitHub takeaways:

  • GitHub is the world's largest host of source code with over 100 million developers using it.
  • GitHub is a web-based repository hosting service and a code-sharing platform for collaboration on software development projects.
  • GitHub offers version control, limitless collaboration, code hosting, issue tracking, and community engagement.
  • To get started with GitHub, sign up for an account, install Git, create a repository, create a branch, make and commit changes, open a pull request, and merge the pull request.
  • Tips for using GitHub effectively include organizing repositories, tracking changes, using pull requests, leveraging the issue tracker, using GitHub Actions for automation, regularly updating repositories, and engaging with the GitHub community.

Wh‎at is GitHub?

To understand GitHub, you need first to understand Git.  

What is Git?

Git is a version control system software/tool where developers work together on software development projects. Git helps developers collaborate, track code changes, and manage projects.

What is GitHub?

GitHub Home Page

         

‎GitHub is a web-based repository hosting service (Git repository) and the world's largest community of developers. It is a code or file-sharing service to collaborate with other developers on programming or software development projects worldwide.

Wh‎at are the benefits of GitHub for developers?

1. Version control

GitHub offers robust version control features. These features allow you to track changes in your code, roll back to previous versions and collaborate on code without conflicts.

📌 What is Version Control: A Guide for DevOps

2. Limitless collaboration

You can easily collaborate with other developers by creating branches, submitting pull requests and reviewing and merging code changes. GitHub encourages collaboration and simplifies managing contributions from multiple developers.

Learn how to add collaborators on GitHub in this Scribe.


         

3. Code hosting

GitHub provides a secure and reliable platform for hosting code repositories. With GitHub, developers can store and share code without needing infrastructure.

4. Issue tracking

GitHub has an issue-tracking system that allows programmers/developers to create, assign and track code issues, bugs and feature requests. This helps manage and prioritize tasks and keeps the software development process organized.

5. Community engagement

GitHub's large community of developers makes it a great platform for networking, showcasing your work and receiving feedback. It can help you establish a professional presence and gain recognition for your contributions.

{{banner-short-v2="/banner-ads"}}

Ho‎w do I get started with GitHub?

To use GitHub, follow these steps:

  1. Sign up for a GitHub account.
  2. Install Git.
  3. Create a GitHub repository.
  4. Create a branch.
  5. Make and commit changes to the branch.
  6. Open a pull request.
  7. Merge the pull request.

We'll walk through each of the steps below.

📌Related resource: 6 AI Tools for Developers

Ho‎w to use GitHub: step-by-step guide

1. Sign up for GitHub


         

First, you need a GitHub account. Create a GitHub account at GitHub (github.com) by providing your information.

A free account is a great place to start if you're in the "GitHub for beginners" stage. You can access unlimited public and private repositories, bug-tracking and project management features. 

One thing to note—you'll only be allowed three collaborators for private repositories. 

2. Install Git

GitHub runs on Git. Before you start using Git or GitHub, you have to download it to your computer. And if it's already installed, you still need to update to the latest version.

You can either install Git as a package or via another installer or download the source code and compile it yourself. 

Download Git here and install it on your computer. Check out this Scribe on How to Connect Git to GitHub to get started.


         

3. Create a GitHub repository

To do anything in GitHub, you need a repository. 

A repository (or repo) is simply a "project" organization dashboard. It is where you store everything pertinent to a project—files, spreadsheets, images, data sets, videos, ideas, etc.  

A repository often includes a README file with information about your project written in the plain text Markdown language.   

Check out this Scribe from one of our users on how to create a new repository on GitHub:


         

Follow these steps to create a repository on GitHub:

1. Create a new repository: Click on the "New repository" in the upper-right-hand corner of the GitHub homepage (or use the drop-down menu and select New repository).

2. Name your repository: In the "Repository name" box, type in a name for your repository, like "new-repo".

3. Add a description: In the "description" box, type a brief description.

4. Select Public or Private for your repository: Select whether your repository will be Public or Private. This Scribe on how to make a GitHub repository public gives you a step-by-step guide:


         

5. Add a README file. Select Add a README file or check the box "Initialize this repository with a README."

6. Click "Create repository" to finish the set up.

This Scribe will show you how to add a folder to GitHub's website user interface:


         

4. Create a branch of the repository 

By default, your GitHub repository has one branch named main/master, considered the definitive branch. 

You can create a branch(s) of the main (copy or snapshot) at that point in time. Branching the GitHub repository lets you have different versions of a repository at one time, allowing you to edit multiple unique versions of a repository at once.

When you start a new branch, it'll be a copy of the main branch (they'll look exactly the same) until you edit it to make new changes. 

Branches can allow you to experiment, make edits, add new features, etc. before committing them to the main without interfering with the main source code. 

To create a repository branch in GitHub:

  1. Click the Code tab of your repository.
  2. Above the file list, click the drop-down menu that says main.
  3. Type a branch name, e.g. readme-edits, into the text box.
  4. Click Create branch: e.g. readme-edits from main.

If you want to download or clone repositories on GitHub, here's a Scribe on how to do it:


         

5. Create and commit changes to a branch 

When you create a new branch, GitHub brings you to the code page for your new branch—a copy of the main before you make any changes. 

You can then make and save changes to the files in your new branch repository. GitHub requires that you make changes, each with an associated commit message—a description explaining why a change was made. 

Here's how to create and commit changes on GitHub:

  1. Under the new branch you created, click the README.md file.
  2. To edit, click the file you want to change, then hit the pencil icon in the upper right.
  3. In the editor, write a bit about yourself. Try using different Markdown elements.
  4. Click "Commit changes."
  5. In the "Proposed changes" box, write a commit message that describes your changes.
  6. Now, click Propose changes.

The changes you've made will be only to the README file on your branch. Now, this branch has content that's different from the main.

6. Open a pull request 

For any branch to be merged into another developer's branch, you must open a pull request.  

A pull request is how GitHub notifies relevant parties about your collaboration request, such as incorporating changes into their branch. It often shows in red and green the differences between the content branches.

You can make a pull request anytime after completing a commit. 

To make a pull request, using the "@" feature to mention specific people you need feedback from is important.  

Use the following steps to open a pull request:

  1. Click the "Pull Requests" tab of your repository.
  2. Click the "New pull request" button.
  3. In the "Example comparisons" box, select the branch you made, then compare it with main (the original).
  4. Assess your changes in the diffs on the Compare page; ensure they're what you want to submit.
  5. Now, click the "Create pull request" button.
  6. Give your pull request a title and write a brief description of the changes you've made.
  7. Finally, click "Create pull request".

7. Merge your pull request

The final step is to merge your pull request into the main branch. After merging your pull request, the changes will be incorporated into the main.

Sometimes, a pull request can introduce changes to code that conflict with the code on main. GitHub will alert you about any conflicting code and prevent merging until resolved. 

You can create a commit that resolves the conflicts or use description/comments in the pull request to have your team discuss the conflicts.

To merge your pull request:

  1. At the bottom of the pull request, click "Merge pull request" into main.
  2. Click Confirm merge. A successful message will appear.
  3. Click Delete branch. Since the pull request is merged and the changes are on main, it's safe to delete the branch.

See how to merge a feature branch into your master branch in this Scribe:


         

Tips for using GitHub effectively

1. Keep your repositories organized and easy to navigate

Use clear and descriptive names for your repositories and create meaningful folder structures. Also, provide brief documentation or README files to guide users through your code.

If you've named a repository but want to change it, here's a Scribe on how to rename a repository in GitHub:


         

2. Keep track of changes

To keep track of changes, use descriptive commit messages. Ensure your commits provide clear and concise messages describing your change's purpose. This allows easy understanding and tracking of changes in the codebase.

If you made a change in GitHub but need to revert it, this Scribe shows you how:


         

3. Use pull requests to collaborate with others 

To effectively collaborate with others, use GitHub's pull request feature. Pull requests allows parties to conduct code reviews and discuss changes before merging them into the main.

Here's how you can approve a pull request in GitHub:


         

4. Use Issue tracker 

Use GitHub's issue tracker to track bugs, feature requests, document enhancement requests, or outline new features. This helps keep track of tasks, prioritize work and engage with the collaborators or community.

5. Leverage GitHub Actions for automation

GitHub Actions allows you to automate various tasks, such as running tests, building and deploying applications or sending notifications. You can use it to create your own custom workflows.

How do GitHub Actions work? Learn how to get started in a few quick steps.


         

6. Regularly update and maintain your repositories

Keep your repositories up to date, promptly address issues and bug reports, and provide documentation or instructions for users to understand and use your code effectively.

7. Engage with the GitHub community

When using GitHub, participate in discussions, follow interesting projects and contribute to open-source repositories. Networking and collaboration with other developers can help you learn, grow and gain recognition for your work.

Here's how to add collaborators on GitHub:


         

GitHub FAQs

How can I promote my GitHub profile?

To promote your GitHub profile, actively participate in open source projects, contribute to repositories and showcase your projects on your portfolio website or blog.

Also, engage with the GitHub community through collaborations, discussions and networking. 

How can I learn and grow with GitHub?

To learn and grow with GitHub, explore open source projects, collaborate with other developers and contribute to various projects.

Use GitHub's features, such as code reviews, issue tracking and more, to enhance your coding knowledge and skills.

What are some GitHub hacks?

  • Use GitHub Actions for automating workflows.
  • Leverage GitHub Pages to host static websites.
  • Use GitHub's search functionality to find relevant repositories or code snippets.
  • Explore GitHub API for integrating GitHub with other tools or services.

How can I use GitHub scripts?

GitHub scripts, like GitHub Actions or Git hooks, allow you to automate tasks or customize workflows.

You can write scripts in various programming languages to perform actions like running tests or deploying code based on specific events in your repository.

How can I use GitHub downloads?

To use GitHub downloads, follow these steps:

  1. Navigate to your GitHub repository and go to the "Releases" section.
  2. Click on the "Draft a new release" button to create a new release.
  3. Provide a version number, release title and description for the release. You can also attach files to the release, such as compiled binaries, installers or documentation.
  4. Click on the "Publish release" button to make the release available.
  5. Users can then access the release page and download the attached files.

Learn how to download a folder from GitHub in this Scribe:


         

Learn more about GitHub with Scribe

Scribe

         

‎Learn how to use GitHub effectively with our Scribe gallery on how to use GitHub.

Scribes provide clear and concise instructions for each task, helping you build your knowledge and skills efficiently.

Scribe lets you create how-to guides while you work and serve them to your team when they need them the most. Do you need to show a teammate how to run a report? A customer how to login? Scribe is the easiest way to show anyone how to do anything.

 @codingtok This is my favorite productivity tool! 👨🏼💻 #ScribeHow #ShareScribe #coding #developer #computerscience  ♬ Aesthetic - Tollan Kim  

‎And, with Scribe, you can focus on what you do best—coding—while the AI takes care of the rest. 

Sign up for a free Scribe account today and learn more about how to use GitHub!

Ready to try Scribe?

Scribe automatically generates how-to guides and serves them to your team when they need them most. Save time, stay focused, help others.