Search Your Question...!

More on Git MCQ's

1. What is the git command to see the last 3 commits in one line ?

   View Answer   

   git log -–oneline -3 



2. How do I view all the commits for the last 2 weeks ?

   View Answer   

   git log -–since=”2 weeks ago” 



3. What is the significance of using –index in the git stash pop - - index command ?

   View Answer   

   To pull the staged changes  



4. What is the command to temporarily store uncommitted ?

   View Answer   

   git stash 



5. What command should I use to retrieve my files that have been temporarily stashed ?

   View Answer   

   git stash pop – index 



6. what is the command to view all the commits made by a specific person (Jim)?

   View Answer   

   git log -–author=”Jim” 



7. What is the git command to see all the commit since 1st January 2017 ?

   View Answer   

   git log -–since=”2017-01-01”



8. A good commit message can have have more then 100 characters.

   View Answer   

   False



9. What is the output of the command git reset -–soft HEAD ~5 ?

   View Answer   

   move the last 5 commits as 1 into the staging area



10. What is the output of the command git reset –hard HEAD ~3?

   View Answer   

   throw away the last 3 commits 



11. I want to take all the changes I made in the staging to my working directory , what command should I use to do this operation ?

   View Answer   

   git reset HEAD



12. A good commit message should be descriptive and specific

   View Answer   

   True 



13. What is the command to amend an incorrect commit message ?

   View Answer   

   git commit –amend -m “correct message”



14. What is the command to pick a commit from a specific branch and move it to another branch ?

   View Answer   

   git cherrypick



15. Which command helps you track the revisions of your revisions in git ?

   View Answer   

    git reflog



16. I have made a commit and discarded it . I can still retrieve that commit using git reflog.

   View Answer   

   True 



17. git reflog track the commits that are made and the commits that are discarded .

   View Answer   

   True



18. What is the git command to move branch pointer to different commit without checkout ?

   View Answer   

   git update-ref



19. git reflog –verbose will print extra information on the screen.

   View Answer   

   True 



20. git bisect is used to identify a commit that has introduced a bug .

   View Answer   

   True 



No comments:

Post a Comment