This is second chapter of git crash course . in this chapter we will cover about git structure and how to create git repository . we will look at internal folder structure of git .
Git Structure
git structure is based on three tree structure where 1 : is git repository 2: is staging 3 : working copy of your codes ,
In this structure we create a repository add some files on them and then after initialising the repository in working copy we make changes in our codes then we add those modified files to staging index then finally we commit it on our repository
3 : Working : first we create some files and code sets , they consider as our working copy | Git Initialize
2 : Staging Index : then we add them in our staging index | Git Add somefile.txt
1 : finally we commit it in our repository | Git commit
Creating first repository :
at this point i am assuming that your have working git installation and little bit knowledge of version control and git structure
Steps to create first git repository
- open terminal or cmd in windows
- change directory to the folder that contains your codes
- [bash]
$git init
[/bash]
- Above command will create local git repository
[bash]$git add . [/bash]
- above command will add all files in staging index
- [bash]$ git commit -m ” Initial Commit ” [/bash]
- above command will commit those files to repository with the ” -m ” message that this is ” initial commit ” you can change message according your personal preference but make that identical so when you look at log you can easily identify what was that