Top 50 Git Interview Questions with Answers

Git Interview Questions with Answers
  1. What is Git?
    a. A version control system
    b. A programming language
    c. A software suite
    d. An operating system

Answer: a

  1. Who developed Git?
    a. Linus Torvalds
    b. Richard Stallman
    c. Bill Gates
    d. Steve Jobs

Answer: a

  1. What is a repository?
    a. A location where code is stored
    b. A person who manages code
    c. A type of code
    d. A software program

Answer: a

  1. What is a branch?
    a. A separate version of the code
    b. A type of commit message
    c. A way to share code with others
    d. A type of tag

Answer: a

  1. What is a commit?
    a. A change made to the code
    b. A type of pull request
    c. A way to merge code
    d. A feature request

Answer: a

  1. What is a pull request?
    a. A way to propose changes to the code
    b. A way to revert changes
    c. A way to merge changes
    d. A way to delete code

Answer: a

  1. What is a merge conflict?
    a. A problem that occurs when two or more people make changes to the same code
    b. A type of error
    c. A type of commit message
    d. A way to share code with others

Answer: a

  1. What is a tag?
    a. A way to mark a specific point in the code’s history
    b. A type of commit message
    c. A way to merge code
    d. A way to delete code

Answer: a

  1. What is a stash?
    a. A way to save changes without committing them
    b. A way to delete code
    c. A way to revert changes
    d. A way to share code with others

Answer: a

  1. What is a remote?
    a. A separate repository that is not on the local machine
    b. A person who manages code
    c. A type of code
    d. A software program

Answer: a

  1. What is the difference between git clone and git fork?
    a. Git clone makes a copy of the repository on your local machine, while git fork creates a copy on GitHub/GitLab.
    b. Git clone creates a copy of the repository on GitHub, while git fork creates a copy on your local machine.
    c. Git clone and git fork both do the same thing.
    d. Git clone creates a new branch, while git fork creates a new repository.

Answer: a

  1. What is the command to initialize a new Git repository?
    a. git init
    b. git clone
    c. git pull
    d. git push

Answer: a

  1. What is the command to add a file to the staging area?
    a. git add filename
    b. git commit
    c. git push
    d. git pull

Answer: a

  1. What is the command to commit changes?
    a. git commit -m “commit message”
    b. git add filename
    c. git push
    d. git pull

Answer: a

  1. What is the command to push changes to a remote repository?
    a. git push
    b. git pull
    c. git add filename
    d. git commit -m “commit message”

Answer: a

  1. What is the command to create a new branch?
    a. git branch new_branch_name
    b. git checkout new_branch_name
    c. git merge new_branch_name
    d. git clone new_branch_name

Answer: a

  1. What is the command to switch to a different branch?
    a. git checkout branch_name
    b. git branch new_branch_name
    c. git merge branch_name
    d. git clone branch_name

Answer: a

  1. What is the command to merge one branch into another?
    a. git merge branch_name
    b. git clone branch_name
    c. git add filename
    d. git push

Answer: a

  1. What is the command to view the commit history?
    a. git log
    b. git branch
    c. git clone
    d. git commit

Answer: a

  1. What is the command to revert changes?
    a. git revert
    b. git reset
    c. git checkout
    d. git pull

Answer: a

  1. What is the command to undo the last commit?
    a. git reset HEAD~1
    b. git revert HEAD~1
    c. git checkout HEAD~1
    d. git commit –amend

Answer: a

  1. What is the difference between git pull and git fetch?
    a. Git pull fetches changes and merges them, while git fetch only fetches changes.
    b. Git pull only fetches changes, while git fetch fetches and merges changes.
    c. Git pull and git fetch do the same thing.
    d. Git pull and git fetch are not actual Git commands.

Answer: a

  1. What is the command to view the changes made to a file?
    a. git diff filename
    b. git log
    c. git branch
    d. git clone

Answer: a

  1. What is the command to create a tag?
    a. git tag tag_name
    b. git push
    c. git pull
    d. git add filename

Answer: a

  1. What is the command to delete a branch?
    a. git branch -d branch_name
    b. git clone branch_name
    c. git add filename
    d. git commit -m “commit message”

Answer: a

  1. What is the command to view the status of the repository?
    a. git status
    b. git log
    c. git branch
    d. git clone

Answer: a

  1. What is the command to view the remote repositories?
    a. git remote -v
    b. git clone
    c. git add filename
    d. git commit -m “commit message”

Answer: a

  1. What is the command to rename a file?
    a. git mv old_filename new_filename
    b. git add filename
    c. git commit -m “commit message”
    d. git push

Answer: a

  1. What is the command to undo changes made to the staging area?
    a. git reset filename
    b. git add filename
    c. git commit -m “commit message”
    d. git push

Answer: a

  1. What is the command to view the changes made to the repository?
    a. git diff
    b. git log
    c. git branch
    d. git clone

Answer: a

  1. What is the command to view the list of remote branches?
    a. git branch -r
    b. git log
    c. git status
    d. git clone

Answer: a

  1. What is the command to fetch changes from a remote repository?
    a. git fetch
    b. git pull
    c. git push
    d. git clone

Answer: a

  1. What is the command to view the list of tags?
    a. git tag
    b. git branch
    c. git log
    d. git clone

Answer: a

  1. What is the command to view the difference between two branches?
    a. git diff branch_1..branch_2
    b. git merge branch_1 branch_2
    c. git pull branch_1 branch_2
    d. git push branch_1 branch_2

Answer: a

  1. What is the command to move a commit from one branch to another?
    a. git cherry-pick commit_hash
    b. git merge branch_1 branch_2
    c. git checkout branch_name
    d. git push

Answer: a

  1. What is the command to rebase a branch?
    a. git rebase branch_name
    b. git merge branch_name
    c. git add filename
    d. git push

Answer: a

  1. What is the command to view the current branch?
    a. git branch
    b. git clone
    c. git log
    d. git status

Answer: a

  1. What is the command to view the list of commits for a specific file?
    a. git log filename
    b. git branch
    c. git checkout
    d. git push

Answer: a

  1. What is the command to undo changes to a specific file?
    a. git checkout filename
    b. git reset filename
    c. git add filename
    d. git push

Answer: a

  1. What is the command to delete a tag?
    a. git tag -d tag_name
    b. git push
    c. git pull
    d. git add filename

Answer: a

  1. What is the command to change the commit message?
    a. git commit –amend
    b. git reset
    c. git revert
    d. git push

Answer: a

  1. What is the command to delete untracked files?
    a. git clean -f
    b. git reset
    c. git revert
    d. git add filename

Answer: a

  1. What is the command to set up a Git repository with a remote?
    a. git remote add remote_name remote_url
    b. git push
    c. git pull
    d. git add filename

Answer: a

  1. What is the command to add multiple files to the staging area?
    a. git add .
    b. git add *
    c. git add filename1 filename2
    d. git add -a

Answer: a

  1. What is the command to view the list of contributors to the repository?
    a. git shortlog
    b. git branch
    c. git log
    d. git clone

Answer: a

  1. What is the command to view the version number of Git?
    a. git –version
    b. git version
    c. git branch
    d. git clone

Answer: a

  1. What is the command to discard changes made to a file?
    a. git checkout filename
    b. git reset filename
    c. git add filename
    d. git push

Answer: a

  1. What is the command to view the list of files in the working directory?
    a. ls
    b. git ls
    c. git list
    d. git dir

Answer: a

  1. What is the command to discard changes made to the entire repository?
    a. git reset –hard
    b. git revert
    c. git add .
    d. git push

Answer: a

  1. What is the command to stash changes without committing them?
    a. git stash
    b. git reset
    c. git revert
    d. git push

Answer: a

ClearCase/ClearQuest SCM Applicant Livermore CA US

mfeighner created the topic: ClearCase/ClearQuest SCM Applicant Livermore CA US

Michael Lee Feighner
831 Turino Street
Livermore, California 94551-2569
Home: (925) 449-8692
Cell: (925) 337-1298
feinerVogel94551@comcast.net
www.linkedIn.com/in/michaelfeighner
PROFESSIONAL SUMMARY
Software/Hardware Engineering Release, Process Documentation

• Maintained US Government DOD Secret Clearance over the past 19 years.
• Lead Change Board activities to align with schedule and budget for Software and
Document releases.
• Recorded change management history in Enterprise Product Data Management
(EPDM, Windchill) in order to maintain audit traceability.
• Proficient in ClearQuest.
• Able to Identify, Control, and Audit Configuration Status Accounting to meet Common
Integrated Processes System (CIPS) and Capability Maturity Model Integration (CMMI)
requirements.
• Utilize ClearCase for Software Configuration Management Control and Build Execution
Release.
• Requirement Management using DOORS (Dynamic Object Oriented Requirement
System).
• Key contributor to Contract Delivery Requirements List (CDRL) Delivery.

TECHNICAL SKILLS
Windows NT/XP
MS Word, Excel,
PowerPoint, Outlook
Shell / Perl Scripting
Visual Basic
MS Visual Studio 2005
e-Commerce
C/C++, UNIX
SQL
PROFESSIONAL EXPERIENCE

LOCKHEED MARTIN CORPORATION – Sunnyvale, CA JAN 1990 – NOV 2009
Staff Configuration Analyst MAR 2008 – NOV 2009
SBIRS (Space-Based Infrared System)
• Managed and directed timely change board activities with accuracy and within budget.
• Maintained change management history in Enterprise Product Data Management (EPDM,
Windchill) for auditable traceability.
• Conducted Configuration Management review of approved documents in Dynamic Object
Oriented Requirement System (DOORS) for requirements traceability in preparation for
formal document release.
• Wrote and maintained Configuration Management (CM) Operation Instructions for training
by others.

Senior Software Configuration Analyst JUL 2007 – MAR 2008
MKV (Multiple Kill Vehicle)
• Created foundation of MKV’s Software Review Boards at program and site level.
• Managed and directed change board activities with accuracy, on schedule, and within
budget.
• Maintained change management history in ClearQuest for auditable traceability.
• Wrote detailed instructions on scheduling and arranging weekly conferences via
teleconferencing.
• Implemented software quality standards based on Configuration Management procedures.
• Established automated build process through MS Visual Studio 2005.

Senior Software Configuration Analyst MAY 2000 – JUL 2007
THAAD (Terminal High Altitude Area Defense)• Resolved discrepancies between Enterprise Product Data Management and Electronic
Data (EPDM, Windchill).
• Assured ClearQuest schema conformed to program’s Configuration Management Plan
maintaining highest level of customer satisfaction.
• Managed and directed, independently, change board activities. Arranged and coordinated
Software Condition of Assembly at Release and Transfer (SW-CART). This enabled
auditable traceability, allowing on-schedule software releases to the customer.
• Arranged Contract Delivery Requirements List (CDRL) deliveries well ahead of schedule.
• Managed ClearQuest and ClearCase administrative functions.
• Compiled software code in Visual Basic.
• Conducted annual internal audits for Program Software Configuration Management.
Maintained department’s procedures.

Special Programs – Senior Software Engineer APR 1996 – MAY 2000
• Software Test and Software Development in C and Assembly in VxWorks Environment

Special Programs – Senior Data Processor JAN 1990 – APR 1996
• Computer Operations in Virtual Machine/Conversational Monitor System Multiple Virtual
Storage Mainframe.
• UNIX (AIX on RS/6000) and VAX/VMS Administration and Software Installation and
Upgrade.

EDUCATION
MS Software Engineering – National University, San Jose, CA
MA Political Science – University of Tübingen, Germany
California State College and University, Foreign Study Program at
University of Heidelberg, Germany
BA Liberal Arts – San Jose State University – San Jose, CA

rajeshkumar replied the topic: Re:ClearCase/ClearQuest SCM Applicant Livermore CA US

Hi mfeighner.

very impressive profile. How we can work together for our community benefits?

Rajesh
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

mfeighner replied the topic: Re:ClearCase/ClearQuest SCM Applicant Livermore CA US
That is a good question. I am finding the “new” market” challenging. Although I received my training and experience through my previous employer of 20 years only for ClearCase and ClearQuest only. Other needed training was not available. What is one to do in today’s market? My skills are transferable, but I am at a loss to many of the applications and skills discussed in this forum.

rajeshkumar replied the topic: Re:ClearCase/ClearQuest SCM Applicant Livermore CA US
Hi,

This is not lose. by referring your profile, you have very depth understanding in SCM and its concept. Also you have worked on Top rated tools in SCM.

I feel, Learning new tools and technology will not be challenging for you.

Whats you future plan? are you searching new job or trying to do something your own?
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

mfeighner replied the topic: Re:ClearCase/ClearQuest SCM Applicant Livermore CA US
Rajesh, thanks for your kind compliments. But why can’t I get a job as a Software Configuration Management/Release Engineer in this market? The following are phrases I have extracted from job openings posted on Monster, Dice, and CareerBuilder depicting a non-existent super Software Configuration Manager. I have never used JAVA, Oracle, SQL (had a four-week course in college ages ago), Maven, Bamboo, Python, VMware, Xen, no experience with automated management/creation of server clusters (training was to take place with last position until budget cuts and lay-offs), Capistrano, LAMP, Phing, Subversion Large Scale Web, MySQL, PHP, Puppet, Bash, Chef, MF, MS SQL RDBMS technologies, no hands-on experience working with GiT and not simply “used’ GiT but rather have used GiT extensively and even better used GiT to replace ClearCase, ANT, Ivy, Bamboo, Maven, Hudson, product installation/configuration and system/unit testing, HTML/XML, no experience working with high volume web sites preferably in an operations type role, no experience in web-facing business and their operation, no Perforce experience, no experience with Subversion, no experience with Agile Build, CruiseControl, no experience with Packaging & Installers i.e., development experience with InstallShield; no development experience with rpm is a plus, no level skills in CVS & Subversion….the list goes on and on. There is nothing wrong with my past experience. It is as you will agree something working in my favor. But that favor has not arrived. We are in a major depression, and employers have increased their requirements to unachievable levels. I will have to accepted by a company that will allow me to mould to their needs, and I know I can do that, but that just is not happening right now.

Mike Feighner
www.linkedIn.com/in/michaelfeighner

rajeshkumar replied the topic: Re:ClearCase/ClearQuest SCM Applicant Livermore CA US
I appreciate your commitments. i wish you all the best.

Kindly let me know if I can help you anyways..

Rajesh
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

rajeshkumar replied the topic: Re:ClearCase/ClearQuest SCM Applicant Livermore CA US
Can you please look at this….

jobs.scmgalaxy.com/
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

mfeighner replied the topic: Re:ClearCase/ClearQuest SCM Applicant Livermore CA US
Thanks. I have been looking in this link for a couple weeks now. I have just applied to 10 more recent application. Yet, it is still the same problem. They are asking for skills I do not have.

GopiNithin replied the topic: Re:ClearCase/ClearQuest SCM Applicant Livermore CA US
Hey Rajesh,
I am very glad to introduce my self. I am a Configuration Manager working with one of the company in chennai. I need few clarifications. Provide your contact details so that we can chat offline.

Thanks
Gopi

Tagged :

Release notes for .net builds

rajeshkumar created the topic: Re: Release notes for .net builds
Hi,

I have used Doxygen for C++ and Java based project which is best for these 2 language. But no experience with other 2 tools.

Based on googling i felt that NDOC3 should suite your requirement as its basically for .net and C#….

Please share with us more experience on this…
NDoc3 is based on NDoc, and is a code documentation generation tool for .NET developers. The goal is to make a fast, extensible, multi-platform .NET documentation tool which supports all of the .NET languages specifications including but not only, C#
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Migration from clearcase to GIT

pshyamala created the topic: Migration from clearcase to GIT
Migration from clearcase source code to GIT. Are there any tools/scripts for doing this.

Regards,
Ashish Pataskar
Module Lead(Build & Release)

rajeshkumar replied the topic: Migration from clearcase to GIT
o, there is no ClearCase to Git bridge, convertor or adaptor that I know of (retaining the full history, with all its events).

Credit –
stackoverflow.com/questions/26967817/clearcase-to-git-migration

But

Also, please read this
therub.org/2013/07/19/clearcase-to-git/
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Good GIT SCM Video at youtube.

rajeshkumar created the topic: Good GIT SCM Video at youtube.
Hi Friends,

This week I am started digging more into to GIT. I hope these videos will be helpful for you as well.

Introduction to Git

Linus Torvalds on git

O’Reilly Webcast: Git in One Hour

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Good PPT slides for GIT on slideshare.net

rajeshkumar created the topic: Good PPT slides for GIT on slideshare.net
Must be referenced.

www.slideshare.net/JamesEdwardGrayII/git-and-github-3675432
www.slideshare.net/terrywang/git-101-tutorial-presentation/
www.slideshare.net/railsconf/smacking-gi…advanced-git-tricks/

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Useful website Reference for GIT

rajeshkumar created the topic: Useful website Reference for GIT
Here are following website good to know more about GIT-SCM.

help.github.com/
progit.org/
git-scm.com/
whygitisbetterthanx.com/

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Urgent requirement for ‘IBM RTC with SCRUM Master’ with our client

ranjita created the topic: Urgent requirement for ‘IBM RTC with SCRUM Master’ with our client
Hi,
Greetings for the Day!!
We have urgent openings for” SCM with Scrum Master” with our client.
Location: Hyderabad
Mode:7+Yrs
JD:
Methods-4+ years:
Scrum
Extreme Programming (XP)
Test Driven Development (TDD)
Continuous Delivery (CD)
Acceptance Test Drive Development (ATDD)

Tools-2+ years:
Rational Team Concert (RTC)
Rational Quality Manager (RQM)
If interested reach me@vasavi@qcadd.com
Note: we will consider 15 Days of notice period only plzzz
It would be appreciated if any one can provide references

Regards,
Vasavi.A
9959188581
Regards,
Vasavi
Recruitments | Q-CAD Private Limited,
Web: www.qcadd.com
Report This
Quick Reply Action Moderate Thank You

Tagged :

This user is in an organization and can’t be deleted.

scmuser created the topic: This user is in an organization and can’t be deleted.
Following error while deleting users from git gub.

This user is in an organization and can’t be deleted.

any solution?

Tagged :