Git for Beginners

What is Git?

Git is a version control software.

  • origin/master is the branch that is on the git server on the internet.
  • master is your local branch.

Basic Usage

To download a repository:

$ cd C:\\Users\\username\\
$ git clone

A folder with the git repository name will be created.

Create a new branch

> git checkout -b my_branch

A new branch with the name my_branch will be created if it doesn’t exist.

Checkout an already existing branch

> git checkout my_branch

Check the status of your repository

> git status

Add new/modified files to the repository

> git add <path_to_file>

Commit your changes

> git commit -m "commit notes"

Push your changes to the git server

> git push origin my_branch

To get the latest git repository, use pull

> git pull origin my_branch

Leave a Reply

Your email address will not be published. Required fields are marked *