Hello friends in this post we are going to discuss about Developers GIT Question with answer | Developers GIT MCQ with Answer | Developers GIT Multiple choice question with answer | Developers GIT TCS Dumps | Developers GIT TCS Fresco Play dumps | Developers GIT TCS Fresco Play Answers
Q1.What is the GIT command to blow away all changes since last commit?
ANS – git checkout filename
Q2.What is the GIT command to skip staging and directly commit the changes directly ?
ANS – git commit -a -m “message”
Q3.What does the command git add. do?
ANS – Adds all the files to staging area
Q4.GIT takes care of access control.
False
Q5.What is the GIT command to see all changes since the last commit ?
ANS – git status
Q6.It is a good practice to use present tense in commit messages.
True
Q7.GIT is a _______
ANS – Distributed Version Control System
Q8.After performing several commits, or cloning a repository with an existing commit history
ANS – git log
Q9.What does the following command perform? Git reset –- soft HEAD^
ANS – Move commit to one before current head
Q10.When I run git fetch from my local repo it will update my local code?
False
Q11.What is the git command to directly create and move to a new branch?
ANS – git checkout -b branchname
Q12.What is the command to delete a branch in GIT?
ANS – git branch -d branchname
Q13.What is the GIT command to create a branch?
ANS – git branch branchname
Q14.What does the command git checkout branchname do?
ANS – Switches from main branch to the new branch
Q15.What is a good practice to follow when you want to back up a local branch?
ANS – Push to remote repo
Q16.What does the GIT command ‘git remote prune origin’ do?
ANS – Cleans up all remote stale repos
Q17.What is the command to delete a remote branch in GIT?
ANS – git push origin : branchname
Q18.A tag in GIT context is a
ANS – Reference to a specific commit
Q19.What is the GIT command to see all the remote branches?
ANS – git branch -r
Q20.If you want to see the changes since last commit in a specific file, what command should you use?
ANS – git diff filename
Q21.What is the output of the following code ‘git log –- pretty = oneline’?
ANS – Display one commit per line with SHA in the beginning
Q22.What does the command ‘git log – – oneline – graph’ do?
ANS – Visual representation of the branch merging into master