0% found this document useful (0 votes)
211 views2 pages

Developer's Git Q&A

The document contains a series of questions and answers about various Git commands, with the questions testing knowledge of commands for common operations like committing, branching, merging, viewing logs and history. Key commands covered include git commit, git branch, git status, git log, git fetch, git push and more. The questions confirm understanding of best practices for Git such as using present tense in commit messages and not including log files in repositories.

Uploaded by

narichows
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
211 views2 pages

Developer's Git Q&A

The document contains a series of questions and answers about various Git commands, with the questions testing knowledge of commands for common operations like committing, branching, merging, viewing logs and history. Key commands covered include git commit, git branch, git status, git log, git fetch, git push and more. The questions confirm understanding of best practices for Git such as using present tense in commit messages and not including log files in repositories.

Uploaded by

narichows
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

//*****TCS Internal*******

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 does the command git add. do?


Adds all the files to staging area -- Correct

GIT takes care of access control.


False -- Correct

What is the GIT command to see all changes since the last commit ?
git status -- Correct

It is a good practice to use present tense in commit messages.


True -- Correct

GIT is a ___
Distributed Version Control System -- Correct

After performing several commits, or cloning a repository with an existing commit


history
git log -- 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 the command to delete a branch in GIT?


git branch -d branchname -- Correct

What is the GIT command to create a branch?


git branch branchname -- Correct

What does the command git checkout branchname do?


Switches from main branch to the new branch -- 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

What is the command to delete a remote branch in GIT?


git push origin : branchname -- Correct
A tag in GIT context is a
Reference to a specific commit -- Correct

What is the GIT command to see all the remote branches?


git branch -r -- 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

It is a good practice to include log files inside a repository.


False -- Correct

What does the command 'git log - - oneline – graph' do?


Visual representation of the branch merging into master -- Correct

You might also like