Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Viewing history

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 191
    Comment on it
    Previous Git Blogs


    Intialize git repostiory
    First Commit
    Two tree architecture and Three tree architecture
    Best basic practices for writing commit messages
    Viewing the commit logs
    Git Basic WorkFlow
    What is HEAD pointer in GIT
    Git Configuration

    In my prevoius blogs we have gone throgh the following

        Creating a local repository with git init
        Adding file with git add
        Commiting changs with git commit
        and checking the status with git status

    Lets talk about viewing the history

     naveen@naveen:/var/www/html/RND/symfony_sites/symfony_todoapp$ git log 
    Git Dispaly
    commit a67edfaa870430ae58dd6d6e8cea68f0c9a08c0a
    Author: Naveen 
    Date:   Mon Dec 14 13:44:18 2015 +0530
    
        my initial commit
    

    Lets add a new file

    naveen@naveen:/var/www/html/RND/symfony_sites/symfony_todoapp$ gedit readme.txt
    it will add a new file to your repository,I have used gedit editor to make changes and creating files. you need to change the global option like
    naveen@naveen:/var/www/html/RND/symfony_sites/symfony_todoapp$ git config --global core.editor gedit
    Lets check the status now
     naveen@naveen:/var/www/html/RND/symfony_sites/symfony_todoapp$ git status 
    Git Display:
    On branch master
    Untracked files:
      (use "git add ..." to include in what will be committed)
    
        readme.txt
    
    nothing added to commit but untracked files present (use "git add" to track)
    

    It show that we have added a file but stil untracked bey git

    lets see what history says

    naveen@naveen:/var/www/html/RND/symfony_sites/symfony_todoapp$ git log
    Git Display:
    commit a67edfaa870430ae58dd6d6e8cea68f0c9a08c0a
    Author: Naveen 
    Date:   Mon Dec 14 13:44:18 2015 +0530
    
        my initial commit
    

    git log have no idea about new files added. this the actual work of git log to only see history which is being tracked by the Git.

    Now lets add the

    naveen@naveen:/var/www/html/RND/symfony_sites/symfony_todoapp$ git add .
    Commit the changes
    naveen@naveen:/var/www/html/RND/symfony_sites/symfony_todoapp$ git commit -m "Readme file added"
    Now see the history
    naveen@naveen:/var/www/html/RND/symfony_sites/symfony_todoapp$ git log
    Git Display
    [master e95efc2] Readme file added
     1 file changed, 1 insertion(+)
     create mode 100644 readme.txt
    naveen@naveen:/var/www/html/RND/symfony_sites/symfony_todoapp$ git log
    
    commit e95efc2d8e94f72f13e1b578b1d80451e8cf2ac8
    Author: naveenkumar 
    Date:   Wed Dec 16 10:49:52 2015 +0530
    
        Readme file added
    
    commit a67edfaa870430ae58dd6d6e8cea68f0c9a08c0a
    Author: Naveen 
    Date:   Mon Dec 14 13:44:18 2015 +0530
    
        my initial commit
    

    So here we go, log has dispaly all the history now.

 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: