ON SERVER

— bare creates a central storage repository, developers would then clone testing.git to create a local copy on their development machines, bare repo names should end with git like we did here for testing.git folder, this way it’s cloned to its original folder name: testing

$ git status
On branch master
Changes not staged for commit:
(use “git add …” to update what will be committed)
(use “git checkout — …” to discard changes in working directory)

modified: README

no changes added to commit (use “git add” and/or “git commit -a”)

add a new file

$ sudo touch index.php

look status in a more compact way, M means modified, A means new file added to the staging area, ?? means hasn’t been tracked yet

$ git status -s or $ git status –short

M README
?? index.php

There are 2 columns for status indicators. The left hand column indicates that the file is staged and the right hand column indicates that it’s modified. The above M indicates that README file is modified in the working directory but not yet staged

let’s add the index.php

$ git add index.php
$ git status -s

M README
A index.php

now update index.php file

$ sudo vi index.php

<?php
echo "hello world";?>

$ git status -s

M README
AM index.php

time to commit, -a allows to skip the staging

$ git commit -am “added new file index.php and update of README”

to lookup the git logs, it shows each committed snapshot which we have 2 snapshots here