- Take me to Video Tutorial
In this section, we will take a look at initializing a git repository
-
Go into a project folder and initialize git
$ cd /Users/lydiahallie/Desktop/myproject $ git init
-
We have initizalized an empty git repository in a
.git
folder -
To list all the contents of the folder including the hidden folder such as .git folder
$ ls -a
- Create a file with a basic sentence
$ touch story1.txt $ echo "This is a beautiful story" >> story1.txt
- To see the status of git
$ git status
- Default branch will be master branch
- Untracked files are files that are not added to the git
- To add a file to the staging area
$ git add story1.txt
- To commit the changes
$ git commit -m "Added first story"