Backlog uses cookies to deliver our services. By visiting our website, you agree to the use of cookies as described in our Cookie Policy.

Select your PC environment:

Let's start off by creating a new local repository. Our goal is to create a new tutorial directory and put it under the Git version control.

We will be using this directory throughout this tutorial.

Windows

Create the tutorial directory anywhere on your computer. Right-click and then click "Git Create repository here" to have that directory tracked by Git.

Click "Git: Create a Repository Here"

In the following screen, click "OK" without checking "Make it Bare".

Creating repositories

Upon successfully creating a repository, click "OK" and close it in the next prompt.

Creating success screen

If everything is done correctly, the tutorial directory will now have a new icon as shown below. If the icon remains unchanged, try right-clicking on the file and choose "Update to the latest status".

Tutorial Directory icon

Mac

Create the tutorial directory anywhere on your machine. After that, run SourceTree.

Click "Add Repository" located on the top left of the bookmarks list window. Alternatively you can choose File > New from the menu bar.

Start SourceTree

Click on "Create a Repository". Enter the target directory name that will be used to create a local repository. Click the "Create" button.

We will bookmark the directory as "tutorial".

Create repository

The new repository should now be listed the bookmarks list.

Bookmark list

Command Line

Create the tutorial directory anywhere on your computer. Access the directory and use the "init" command to turn that directory into a local Git repository.

$ git init

Follow the steps below to turn the new tutorial directory into a Git repository.

$ mkdir tutorial $ cd tutorial $ git init Initialized empty Git repository in /Users/yourname/Desktop/tutorial/.git/

Now that you're ready, let's commit some files to this respository.