Git Version Controlling System
  

Q. Git is a ___________.

  • Distributed Version Control System
  • Centralized Version Control System
  • None of the options
  • Centrally Distributed System

Q. What is the Git command to skip staging and commit the changes directly?

  • git commit
  • git commit -a -m "message"
  • git add changes
  • git skip stage

Q. How to display only the names of the changed files?

  • git log
  • git diff --name-only
  • git status
  • None of the options

 

Q. What is the Git command to view all the commits since 1st January 2017 ?

  • git log
  • show git log since Jan 1 2017
  • git log --since="2017-01-01"
  • None of the options

Q. When you run git fetch from your local repo, it will update your local changes in working area?

  • True - It fetches the latest changes and merges with the local changes
  • False - It updates local repo only and does not affect the working area

Q. Which type of remote URL does not require your user-name and password while for cloning or pushing?

  • Https Url
  • GSH url
  • HTTP url
  • SSH Url

Q. Which command can you use to update remote refs with local refs?

  • git update
  • git fetch
  • git pull
  • git push

 

Q. What is the Git command to create a branch?

  • git add branch branchname
  • git create branch branchname
  • git branch branchname
  • git invoke branch branchname

 

Q. When you run git fetch from my local repo, will it update your local code and target branch?

  • No, the command will only download the new commits and keep them in a separate branch in local repo
  • Yes, the command will download new commits from remote and merge to the target branch
  • No, it will throw error
  • None of the above

Q. Which of the following creates new commit when you pull new changes from master to the feature branch?

  • git merge master
  • git pull origin master
  • git rebase master
  • None of the above

Q. Developers A and B are building the same feature on feature/X branch. Developer B made some changes and pushed to the remote. How can developer A get the changes in the local repo code and build on top of developer B's work?

  • git log
  • git push
  • git checkout
  • git pull

Q. How can you fix a broken commit?

  • git rebase
  • git fix
  • git reset
  • git commit --amend

 

Q. What does the command Git reset -- soft HEAD^ perform?

  • Moves commit to one after current head
  • Moves commit to one before current head
  • None of the options
  • Moves commit to the first head

Q. What is the Git command to blow away all the changes in a file in the working area, since the previous commit?

  • git status filename
  • git rm filename
  • git log filename
  • git checkout filename

Q. How to delete unpublished Git commits and get rid of them permanently?

  • git reset --soft
  • git reset --hard
  • git revert
  • git delete

Q. What is the Git command to view the last 3 commits in one line ?

  • git log --oneline -3
  • git show log -3
  • git log
  • git last 3 commits

Q. What does the command git add. do?

  • Adds all the files to repo
  • None of the options
  • Adds all the files to the local directory
  • Adds all the files to the staging area

Q. Which command shows the changes between commits?

  • git diff
  • git status

Q. What is the Git command to view all the remote branches?

  • None of the options
  • git branch -r
  • git -v branch
  • git view remote branch

Q. Which command shows the difference between the working directory and the index or staging area?

  • git range
  • git diff
  • git status
  • git stat

Q. How would you display the list of files changed in a particular commit SHA ?

  • git diff
  • git log SHA1
  • git status SHA1
  • git show --name-only SHA1

Q. Which command would you use to view the history of commits?

  • git log
  • git show history
  • git show commits
  • git view history

 

Q. What is the command to reset your index as well as the working directory to the state of your last commit?

  • git checkout
  • git reset
  • git clean
  • git revert

 

Q. What is the command to delete a branch in your remote repository?

  • git branch -d branchname
  • git push origin -d branchname
  • None of the options
  • git delete branchname

Q. Which of the following best describes Git?

  • Access Control System
  • Version Control System
  • Role Control System
  • None of the options

Q. How can you temporarily switch to a different commit?

  • git checkout commitSHA.
  • all the above options
  • git commit commitSHA
  • git reset commitSHA

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

  • git log --author="Jim"
  • git log - who="Jim"
  • git log - "Jim"
  • git log

Q. What is a good practice to follow when you want to backup a local branch?

  • Create another copy
  • None of the options
  • Move to another PC
  • Push to remote repo

 
Institute Finder



Enter Full Institute Name

Usefull Links
© 2021 Eduforum. All Rights Reserved.

Enter login details.

UserName Password

Recover Password

Enter your Registered Email Address to receive new password.
Subscribe Newsletter