2 Creating a Repository (git init)

Key terms/commands

  • Repository (repo): a repo tracks all the changes you made in that directory. In tangible form, it is a .git/ folder that lives inside the directory.

  • git init: creates a repository (the .git/ folder).

2.1 Create a directory call workdir in your home directory for this tutorial

2.2 Create a repository, where git store versions of your file

Create a repository within a folder

## Initialized empty Git repository in /home/travis/workdir/.git/

Check that a hidden folder .git has been created

## .
## ..
## .git

Check the status of git

## On branch master
## 
## No commits yet
## 
## nothing to commit (create/copy files and use "git add" to track)

The status tells you have nothing to commit (last line).


You now have a repository (i.e., a .git/ folder) within a directory that you want to track!