Skip to content

MicKaranja/git-intro

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Releases

No releases published

Packages

No packages published