Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

What is GitHub?


HTML

GitHub is a code hosting platform for collaboration and version control.

GitHub lets you (and others) work together on projects.


Sign up for GitHub at https://github.com/:

GitHub

GitHub essentials are:

  • Repositories
  • Branches
  • Commits
  • Pull Requests
  • Git (the version control software GitHub is built on)

Example

$ git push origin heroku
$ cd /etc/
$ ls

Repository

A GitHub repository can be used to store a development project.

It can contain folders and any type of files (HTML, CSS, JavaScript, Documents, Data, Images).

A GitHub repository should also include a licence file and a README file about the project.

A GitHub repository can also be used to store ideas, or any resources that you want to share.


Branch

A GitHub branch is used to work with different versions of a repository at the same time.

By default a repository has a master branch (a production branch).

Any other branch is a copy of the master branch (as it was at a point in time).

New Branches are for bug fixes and feature work separate from the master branch. When changes are ready, they can be merged into the master branch. If you make changes to the master branch while working on a new branch, these updates can be pulled in.


Commits

At GitHub, changes are called commits.

Each commit (change) has a description explaining why a change was made.


Pull Requests

Pull Requests are the heart of GitHub collaboration.

With a pull request you are proposing that your changes should be merged (pulled in) with the master.

Pull requests show content differences, changes, additions, and subtractions in colors (green and red).

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

A a great way to learn GitHub, before working on larger projects, is to open pull requests in your own repository and merge them yourself.

You merge any changes into the master by clicking a "Merge pull request" button.

GitHub

After merging you can delete the branch by clicking a "Delete branch button".

GitHub

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.