Git Product home page Git Product logo

git-intro's Introduction

DSC - Kabarak

Introduction to Git version Control

GitHub is a code hosting platform for version control and collaboration.
It lets you and others work together on projects from anywhere.

We will have a look at some essentials like repositories, branches, commits, and Pull Requests.
You’ll create your own Hello World repository and learn GitHub’s Pull Request workflow, a popular way to create and review code. You’ll learn how to:

  1. Create and use a repository.
  2. Start and manage a new branch.
  3. Make changes to a file and push them to GitHub as commits.
  4. Open and merge a pull request.

1. To create a new repository


  • In the upper right corner, next to your avatar or identicon, click and then select New repository.
  • Name your repository hello-world.
  • Write a short description.
  • Select Initialize this repository with a README.

2. Branching


It is a way to work on different versions of a repository at one time.
By default your repository has one branch named master which is considered to be the definitive branch. We use branches to experiment and make edits before committing them to master.

When you create a branch off the master branch, you’re making a copy, or snapshot, of master as it was at that point in time. If someone else made changes to the master branch while you were working on your branch, you could pull in those updates.

3. Make and commit changes


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

4. PRs (Pull Requests) & Commits


PRs 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. PRs show diffs, 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 @mention 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.