Skip to content

Desi banjara

  • Microsoft AZ-900 Certification Exam Practice Questions – 6 Microsoft AZ-900 Certification Exam
  • One more year older.. Well, it is better to think another way you are just one more day older than yesterday. Have a lovely Birthday! Birthday Wishes
  • I celebrate this special day for a special someone who is the source of inspiration and guiding light for the entire family. Happy birthday dear mom! Birthday Wishes For Mom
  • Birthdays are moments to celebrate the year that has gone by and look towards the one ahead with hope and enthusiasm. Wishing you a very happy birthday. Birthday Wishes
  • “You are today where your thoughts have brought you; you will be tomorrow where your thoughts take you.”– James Allen Motivational & Inspirational Quotes
  • Specs comparison – CANON 1300D VS CANON 1200D Cameras
  • Interview question: How does C# differ from C++? C# development
  • SQL Server Interview questions Interview questions

Top 20 GIT Interview Questions

Posted on December 25, 2018 By DesiBanjara No Comments on Top 20 GIT Interview Questions

Top 20 [amazon_textlink asin=’B01ISNIKES|1449316387′ text=’GIT ‘ template=’ProductLink’ store=’desibanjara22-21|desibanjaraco-21′ marketplace=’IN|UK’ link_id=’68a83645-0879-11e9-9eea-b3538ea6ba7b’] interview questions:

 

  1. What is a repository in GIT?

Git stores this information in a data structure called a repository. A repository contains a directory named .git, where git keeps all of its metadata for the repository. The content of the .git directory are private to git.

  1. How can you create a repository in Git?

In Git, to create a repository, create a directory for the project if it does not exist, and then run command “git init”. By running this command .git directory will be created in the project directory, the directory does not need to be empty.

  1. What is git clone command do?

The git clone command creates a copy of an existing Git repository.  To get the copy of a central repository, ‘cloning’ is the most common way used by programmers.

  1. What is the command you can use to write a commit message?

The command that is used to write a commit message is “git commit –a”.

–a option instructs git to commit the new content of all tracked files that have been modified.

  1. What is ‘git push’ in GIT?

‘git push’ updates remote refs along with associated objects.

git push –f option you can use to do force push

  1. What is another option for merging?

“Rebasing” is an alternative to merging in git.

  1. What is “Rebasing” and what is the syntax for “Rebasing” in Git?

git rebase is a command which will merge another branch into the branch where you are currently working, and move all of the local commits that are ahead of the rebased branch to the top of the history on that branch.

The syntax for rebase is

“git rebase [new-commit] “

  1. What is GIT stash?

git stash takes the current state of the working directory and index and puts in on the stack for later and gives you back a clean working directory.  So in case if you are in the middle of something and need to jump over to the other job, and at the same time you don’t want to lose your current edits then you can use GIT stash.

Example if you want to rebase with develop but you have some local changes. You can stash it first and then do the rebase. Once you will be happy with rebase. You can do “stash pop” to get that changes back in your branch. Steps below:

git stash

git stash list

git checkout develop

git pull

git checkout feature-nhso-3227-emis-linkage-status-codes

git rebase develop

git status

git stash pop

  1. What is GIT stash drop?

When you are done with the stashed item or want to remove it from the list, run the git ‘stash drop’ command.  It will remove the last added stash item by default, and it can also remove a specific item if you include as an argument.

  1. What is the difference between ‘git remote’ and ‘git clone’?

‘git remote add’  just creates an entry in your git config that specifies a name for a particular URL.  While, ‘git clone’ creates a new git repository by copying and existing one located at the URI.

[amazon_link asins=’1449325866′ template=’ProductAd’ store=’desibanjara22-21′ marketplace=’IN’ link_id=’29351ecb-087a-11e9-b084-c1b28661d721′]

[amazon_link asins=’1449325866′ template=’ProductAd’ store=’desibanjaraco-21′ marketplace=’UK’ link_id=’29351ecb-087a-11e9-b084-c1b28661d721′]

  1. What is the function of ‘git diff ’ in git?

‘git diff ’ shows the changes between commits, commit and working tree etc.

  1. What is ‘git status’ is used for?

As ‘Git Status’ shows you the difference between the working directory and the index, it is helpful in understanding a git more comprehensively.

  1. What is the difference between the ‘git diff ’and ‘git status’?

‘git diff’ is similar to ‘git status’, but it shows the differences between various commits and also between the working directory and index.

  1. What is the function of ‘git checkout’ in git?

A ‘git checkout’ command is used to update directories or specific files in your working tree with those from another branch without merging it in the whole branch.

  1. What is the function of ‘git rm’?

To remove the file from the staging area and also off your disk ‘git rm’ is used.

  1. What is the function of ‘git stash apply’?

When you want to continue working where you have left your work, ‘git stash apply’ command is used to bring back the saved changes onto the working directory.

  1. What is the use of ‘git log’?

To find specific commits in your project history- by author, date, content or history ‘git log’ is used.

  1. What is ‘git add’ is used for?

‘git add’ adds file changes in your existing directory to your index.

  1. What is the function of ‘git reset’?

The function of ‘Git Reset’ is to reset your index as well as the working directory to the state of your last commit.

reset git branch to origin version:

git checkout mybranch

git reset –hard origin/mybranch

  1. How will you know in GIT if a branch has been already merged into master?

Git branch—merged lists the branches that have been merged into the current branch

Git branch—-no merged lists the branches that have not been merged

[amazon_link asins=’1787120724,B0769JLP9C,1449325866,B01ISNIKES,8132231937,B07CDV9LJD,B00QFIA5OC,1782168451,1783553758′ template=’ProductGrid’ store=’desibanjara22-21′ marketplace=’IN’ link_id=’75aeb652-0879-11e9-aaed-6744dc20efd0′]

[amazon_link asins=’1449316387,1617292419,1789137543,B00QFIA5OC,1449325866,B01GO8ZVFA,1491911182,1978117515,1484200772′ template=’ProductGrid’ store=’desibanjaraco-21′ marketplace=’UK’ link_id=’9997ad94-0879-11e9-bc08-4dbf6eb24b6c’]

GIT, Interview questions, IT/Software development Tags:GIT, Interview questions, IT/Software development

Post navigation

Previous Post: Happy Guru Nanak Jayanti 2018: Wishes, Quotes, Status, Messages, Greetings, SMS
Next Post: Happy New Year 2020 Wishes Images, Quotes, Status

Related Posts

  • Interview question: How does C# differ from C++? C# development
  • ASP.Net MVC Interview Questions ASP.Net MVC
  • Interview questions – Microsoft Word Interview questions
  • Interview question: What is the purpose of an access specifier in C#? C# development
  • Interview question: What are the namespaces in C#.NET? C# development
  • Differences between struct and classes in C# : Interview question C# development

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *



Archives

  • February 2023
  • February 2022
  • June 2021
  • March 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • July 2020
  • June 2020
  • April 2020
  • December 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • January 2018
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • August 2015
  • May 2015
  • April 2014
  • November 2013

Categories

  • Acer
  • Amazon AWS Certification Exam
  • Amazon Kindle
  • Android phones
  • ASP.Net MVC
  • ASP.NET Web API
  • AWS DevOps Engineer Professional Exam
  • AZ-300: Microsoft Azure Architect Technologies Exam
  • Azure Active Directory
  • Azure App Services
  • Azure Data Factory
  • Azure Logic Apps
  • Azure Mobile Apps
  • Azure Virtual Machine
  • Best Wishes Messages
  • birthday messages for boyfriend
  • Birthday messages For Girlfriend
  • Birthday Wishes
  • Birthday Wishes For Mom
  • Business
  • C# development
  • Cameras
  • Canon
  • Cloud
  • Cloud services
  • digital-cameras
  • Diwali
  • Entrepreneurship
  • eReaders
  • Family Quotes
  • Family Quotes
  • Friendship Quotes
  • Gadgets
  • Games
  • Get Well Soon Messages
  • GIT
  • Good Morning Wishes
  • Google
  • Gratitude Quote
  • Guru Nanak Jayanti
  • Halloween
  • Happiness Quote
  • Happy Diwali Wishes
  • Happy Independence Day Wishes
  • Happy New Year Wishes
  • HTC
  • HTC One
  • HTML
  • I Miss You Messages
  • Inspirational Quotes
  • Inspirational Travel Quotes
  • Interview questions
  • IT/Software development
  • Leadership Quote
  • Life lessons
  • Love Quotes
  • Love shayari
  • Messages
  • Microsoft AI-900 Certification Exam
  • Microsoft AZ-104 Certification Exam
  • Microsoft AZ-204 Certification Exam
  • Microsoft AZ-900 Certification Exam
  • Microsoft Azure
  • Microsoft Azure certifications
  • Microsoft Exam AZ-220
  • Microsoft Excel
  • Microsoft Office
  • Microsoft word
  • Mobile phones
  • Motivational & Inspirational Quotes
  • Nature Quotes
  • Nexus
  • Nikon
  • Pixels
  • PL-200: Microsoft Power Platform Functional Consultant Certification
  • PL-900: Microsoft Power Platform Fundamentals
  • postman
  • Quotes
  • Robin Sharma
  • Samsung Galaxy S5
  • Self improvement quotes
  • Self-Confidence Quote
  • SonarQube
  • Sony PlayStation 4
  • SQL
  • SQL Server
  • Success Quotes
  • Travel Quotes
  • Uncategorized
  • Uplifting Quotes
  • WCF (Windows Communication Foundation)
  • Web development
  • Wishes
  • Wishes for Newborn Baby

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org



Recent Posts

  • Azure Data Factory
  • What is Azure Active Directory?
  • Azure Virtual Machine
  • Azure Logic Apps
  • Azure Mobile Apps

Recent Comments

  • Yosianus on Error while sending json model in POST request to web API service using postman
  • Don’t count candles See the light, Don’t count years Enjoy your life! Birthday Wishes
  • “We must embrace pain and burn it as fuel for our journey.”– Kenji Miyazawa Motivational & Inspirational Quotes
  • “I travel a lot; I hate having my life disrupted by routine.” – Caskie Stinnett Quotes
  • Interview question: Can you return multiple values from a function in C#? C# development
  • AWS DevOps Engineer Professional Exam Practice Questions – 8 AWS DevOps Engineer Professional Exam
  • !!! “सफलता के 20 मँत्र” !!! Life lessons
  • Happy Guru Nanak Jayanti 2018: Wishes, Quotes, Status, Messages, Greetings, SMS Guru Nanak Jayanti
  • “When things are bad, we take comfort in the thought that they could always get worse. And when they are, we find hope in the thought that things are so bad they have to get better.”– Malcolm S. Forbes Motivational & Inspirational Quotes

Copyright © 2023 Desi banjara.

Powered by PressBook News WordPress theme