Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How Git store its files

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 223
    Comment on it

    In my Last Blog (init git) I mentioned how to initialize git repository, Now lets see what git init did and also understand where git stores its files to do version control on our project.

    On terminal use the UNIX ls command to list what's in the directory

     naveen@naveen:/var/www/html/RND/symfony_sites/symfony_todoapp$ ls 
    you wont see anything here actually its empty

    pas special option here which is -la

     naveen@naveen:/var/www/html/RND/symfony_sites/symfony_todoapp$ ls -la 

    ls with combination of -la will display all the hidden dot files and and also any file that has a dot in front of it , now you can see .git directory that is created by initialize command. Git stores all of its tracking information inside this .git directory. we can think of its as a Git's workspace where Git does everything for tracking the project

    If we want to remove Git and remove version control from our project , then simply remove this .git directory. Once you removed it git wont be no longer tracking our project.

    Lets see whats inside .git directory

     naveen@naveen:/var/www/html/RND/symfony_sites/symfony_todoapp/.git$ ls -la 

    file's you will see could be something like these.

    drwxrwxr-x 7 naveen naveen 4096 Dec 14 11:59 .
    drwxr-xr-x 9 naveen naveen 4096 Dec 14 11:59 ..
    drwxrwxr-x 2 naveen naveen 4096 Dec 14 11:59 branches
    -rw-rw-r-- 1 naveen naveen   92 Dec 14 11:59 config
    -rw-rw-r-- 1 naveen naveen   73 Dec 14 11:59 description
    -rw-rw-r-- 1 naveen naveen   23 Dec 14 11:59 HEAD
    drwxrwxr-x 2 naveen naveen 4096 Dec 14 11:59 hooks
    drwxrwxr-x 2 naveen naveen 4096 Dec 14 11:59 info
    drwxrwxr-x 4 naveen naveen 4096 Dec 14 11:59 objects
    drwxrwxr-x 4 naveen naveen 4096 Dec 14 11:59 refs
    

    do not touch or configure any of these files as git will be using them for tracking project. Only file that you could configure is config file. To configure this file it better and recommended to dot it using git commands

    everything that Git does is going to be stored in this single top-level directory, that's very different from svn. svn puts tracking files in every single directory in a project.So if you wanted to remove svn, you have to go through and actually pull out those .svn files from every single directory so that it will stop tracking those.

    Git doesn't do that, Git puts them all in .git directory at one place and that make easy to remove git from project

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: