EN
Git - create local repository
9 points
In this short article, we would like to show how to create local repository using Git.
Git is distributed version control system that lets to create local repositories. Using local repository we are able to track local changes in indicated directory. Using that repositories we do not push changes to remote server.
Quick solution (run the commands):
xxxxxxxxxx
1
mkdir local_repository_name && cd "$_" && git init
Where: commands create directory and initialize local git repository inside.
In this section, we want to show how to create local repository that will be called my_gallery
.
Simple steps:
- create local directory using:
xxxxxxxxxx
1mkdir my_gallery
- goto local directory using:
xxxxxxxxxx
1cd my_gallery
- create local repository using:
xxxxxxxxxx
1git init
Commits and changes tracking can be achieved using:
xxxxxxxxxx
1
# displaying changes as paths (files and directories)
2
git status
3
4
5
# displaying changes in content (files and directories)
6
git diff
7
8
9
# adding changes to local repository
10
git add -A
11
git commit -m "Put changes comment here ..."
12
13
14
# displaying changes history
15
git log
16
git log --graph
17
git log --online
Hint:
git push
is not used because we want to track changes locally.