Skip to content

Latest commit

 

History

History
143 lines (87 loc) · 2.14 KB

08-Practice-Test-Git-Log.md

File metadata and controls

143 lines (87 loc) · 2.14 KB

Practice Test - Git Log

Solutions to practice test - git log

  • We have initialised git repo in /home/sarah/story-blog. Check git log command output in that directory

    $ cd /home/sarah/story-blog
    $ git log
    
  • Run git add .;git commit -m "Added the lion and mouse story"

    $ git add .
    $ git commit -m "Added the lion and mouse story"
    
  • Check git log command output in that directory

    $ git log
    
  • Which info is not displayed in git log?

    List of changed files
    
  • You can list the changed files as well using the --name-only option with the git log command

    $ git log --name-only
    
  • Which branch has the changes been committed to?

    $ git log
    
  • Who is the Author of the commit in git repo?

    $ git log
    
  • Check git log where commit message is Added a new story

    $ git log --name-only
    
  • What is the option for git log command to display the logs in compact way (one log per line)?

    $ git log --oneline
    
  • Go to cd /home/sarah/learning-app-ecommerce and run git log

    $ cd /home/sarah/learning-app-ecommerce
    $ git status
    $ git log
    
  • You may list the last few commits alone using the --max-count option like this git log -n 3 or git log --max-count 3

    $ git log -n 3
    $ git log --max-count 3
    
  • Go to cd /home/sarah/learning-app-ecommerce and run git log -n 1

    $ git log -n 1
    $ git log --max-count 1
    
  • Go to cd /home/sarah/learning-app-ecommerce and run git log --name-only and look for the commit that changed the file js/theme.js

    $ cd /home/sarah/learning-app-ecommerce
    $ git log --name-only