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):
mkdir local_repository_name && cd "$_" && git init
Where: commands create directory and initialize local git repository inside.
Practical example
In this section, we want to show how to create local repository that will be called my_gallery.
Simple steps:
- create local directory using:
mkdir my_gallery - goto local directory using:
cd my_gallery - create local repository using:
git init
Repository usage
Commits and changes tracking can be achieved using:
# displaying changes as paths (files and directories)
git status
# displaying changes in content (files and directories)
git diff
# adding changes to local repository
git add -A
git commit -m "Put changes comment here ..."
# displaying changes history
git log
git log --graph
git log --online
Hint:
git pushis not used because we want to track changes locally.