More on Git | Fresco Play
Question 1: What is the git command to see the last 3 commits in one line ?
Answer: git log -–oneline -3
Question 2: How do I view all the commits for the last 2 weeks ?
Answer: git log -–since=”2 weeks ago”
Question 3: What is the significance of using –index in the git stash pop - - index command ?
Answer: To pull the staged changes
Question 4: What is the command to temporarily store uncommitted ?
Answer: git stash
Question 5: What command should I use to retrieve my files that have been temporarily stashed ?
Answer: git stash pop – index
Question 6: what is the command to view all the commits made by a specific person (Jim)?
Answer: git log -–author=”Jim”
Question 7: What is the git command to see all the commit since 1st January 2017 ?
Answer: git log -–since=”2017-01-01”
Question 8: A good commit message can have have more then 100 characters.
Answer: False
Question 9: What is the output of the command git reset -–soft HEAD ~5 ?
Answer: move the last 5 commits as 1 into the staging area
Question 10: What is the output of the command git reset –hard HEAD ~3?
Answer: throw away the last 3 commits
Question 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 ?
Answer: git reset HEAD
Question 12: A good commit message should be descriptive and specific
Answer: True
Question 13: What is the command to amend an incorrect commit message ?
Answer: git commit –amend -m “correct message”
Question 14: What is the command to pick a commit from a specific branch and move it to another branch ?
Answer: git cherrypick
Question 15: Which command helps you track the revisions of your revisions in git ?
Answer: git reflog
Question 16: I have made a commit and discarded it . I can still retrieve that commit using git reflog.
Answer: True
Question 17: git reflog track the commits that are made and the commits that are discarded .
Answer: True
Question 18: What is the git command to move branch pointer to different commit without checkout ?
Answer: git update-ref
Question 19: git reflog –verbose will print extra information on the screen.
Answer: True
Question 20: git bisect is used to identify a commit that has introduced a bug .
Answer: True
Post a comment
Get your FREE PDF on "100 Ways to Try ChatGPT Today"
Generating link, please wait for: 60 seconds
Comments
Join the conversation and share your thoughts! Leave the first comment.