Professional Documents
Culture Documents
Installing Git: Git Is Available in The Official Package Repository of Centos 7.5
Installing Git: Git Is Available in The Official Package Repository of Centos 7.5
$ cd YOUR/PROJECT/DIRECTORY
Now run the following command to initialize the directory for Git:
$ git init
The directory should be initialized as you can see from the screenshot below.
Tracking Files in a Git Repository
In a Git repository, you first tell Git what files or directories to track for
changes. This is also called adding files or directories to the Git repository.
You can check the status of your Git repository with the following command:
$ git status
As you can see, I have one untracked file index.php
You can add all the files and directories in your newly created Git repository
as follows:
$ git add -A
$ git log
Or
$ git log --oneline
As you can see, my previous commit is listed.
A new directory should be created in the directory where you ran the
command from as you can see:
If you navigate to the directory and check you should see all the commits of
that Git repository: