Developer's Git Q&A
Developer's Git Q&A
What is the GIT command to blow away all changes since last commit?
git checkout filename -- Correct
What is the GIT command to skip staging and directly commit the changes directly ?
git commit -a -m “message” -- Correct
What is the GIT command to see all changes since the last commit ?
git status -- Correct
GIT is a ___
Distributed Version Control System -- Correct
What does the following command perform? Git reset –- soft HEAD^
Move commit to one before current head
***********************************************************************************
**********************
When I run git fetch from my local repo it will update my local code?
False -- Correct
What is the git command to directly create and move to a new branch?
git checkout -b branchname -- Correct
***********************************************************************************
**********************
What is a good practice to follow when you want to back up a local branch?
Push to remote repo -- Correct
What does the GIT command 'git remote prune origin' do?
Cleans up all remote stale repos -- Correct
If you want to list all the changes and know who made them at what time , what
command should you use?
git which user -- Wrong
If you want to see the changes since last commit in a specific file, what command
should you use?
git diff filename -- Correct
What is the output of the following code 'git log –- pretty = oneline'?
Display one commit per line with SHA in the beginning -- Correct
What is the GIT command to view the log with code level changes?
git log show code , git -l code -- Wrong