{"id":8582,"date":"2020-01-10T10:51:16","date_gmt":"2020-01-10T10:51:16","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=8582"},"modified":"2021-11-15T06:09:24","modified_gmt":"2021-11-15T06:09:24","slug":"git-interview-questions-and-answer-part-8","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/git-interview-questions-and-answer-part-8\/","title":{"rendered":"Git Interview Questions and Answer Part \u2013 8"},"content":{"rendered":"\n<p><strong>What are the fundamental concepts in Git&#8217;s object model?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Commits, trees and leaves<\/li><li>Commits, files and branches<\/li><li>Commits, tags and branches<\/li><li><strong>Commits, snapshots, and references (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What are the characteristics of a well-formed commit message?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>It should consist of a short one-sentence summary followed by an optional longer description. (Ans)<\/strong><\/li><li>It should have a total maximum length of 50 characters.<\/li><li>It should be short and concise.<\/li><li>It should have lines that are no longer than 72 characters.<\/li><\/ul>\n\n\n\n<p><strong>What is the merge-base between two commits?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The list of all common parents of the two commits<\/li><li><strong>The first common parent of the two commits (Ans)<\/strong><\/li><li>The oldest common parent of the two commits<\/li><li>A special reference pointing to the commit that is being merged into the other one<\/li><\/ul>\n\n\n\n<p><strong>How do you make sure that each commit represents a single set of changes? <\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>You use the index to select which changes are going to be part of the commit. (Ans)<\/strong><\/li><li>You make sure that all the changes in our working directory are relate- <\/li><li>You always work on one kind of change at a time.<\/li><li>You use branches to isolate different kinds of changes.<\/li><\/ul>\n\n\n\n<p><strong>Why is the reflog important when rewriting history?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Because it allows you to see a list of references currently in the repository<\/li><li>Because it allows you to amend existing commits<\/li><li>Because it allows you to see a log of the commits currently in the repository<\/li><li><strong>Because it allows you to restore history to a previous state (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>TFS Pull Request Notifications can only be configured at the team level.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>True<\/li><li><strong>False (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>How do you get commits to a remote repository such as GitHub?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Checkin<\/li><li><strong>Push (Ans)<\/strong><\/li><li>Commit<\/li><li>Upload<\/li><\/ul>\n\n\n\n<p><strong>How many options do you have for source control in TFS 2013?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>2 (Ans)<\/strong><\/li><li>3<\/li><li>4<\/li><li>1<\/li><\/ul>\n\n\n\n<p><strong>You can include external Git repositories in an automated TFS Buil- <\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>false <\/li><li>true (Ans)<\/li><\/ul>\n\n\n\n<p><strong>When do Reference CodeLens Indicators get updated on a Method definition?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>When you commit your changes locally<\/li><li><strong>As soon as you add code that references that method (Ans)<\/strong><\/li><li>When you compile your code<\/li><li>When you push your changes to the server<\/li><\/ul>\n\n\n\n<p><strong>What information can you see on the Pull Request details screen in TFS?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Code Changes<\/li><li>Source branch<\/li><li>File listing<\/li><li>Target branch<\/li><li>Discussion<\/li><li><strong>All of these (Ans)<\/strong><\/li><li>Reviewers<\/li><\/ul>\n\n\n\n<p><strong>What version control approaches are used by Centralized Version Control systems?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>All of the Above (Ans)<\/strong><\/li><li>Edit\/Commit<\/li><li>None of the Above<\/li><li>Check-in\/Check-out<\/li><\/ul>\n\n\n\n<p><strong>Pushing your local repository to a central Git repository includes all your commits. <\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>true (Ans)<\/strong><\/li><li>false<\/li><\/ul>\n\n\n\n<p><strong>To access a file&#8217;s history in Git, you must access a central repository.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>False (Ans)<\/strong><\/li><li>True<\/li><\/ul>\n\n\n\n<p><strong>If you create a new method, when does the CodeLens History indicator reflect that you are the author?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>When you compile your code<\/li><li>When you push your changes to the server<\/li><li>As soon as the method is created<\/li><li><strong>When you commit your changes locally (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>If your co-worker changes a method and pushes the change to the server, when does CodeLens tell you about the change? <\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>When you push your changes to the server<\/li><li>When she commits her changes locally<\/li><li><strong>When you pull her changes from the server (Ans)<\/strong><\/li><li>As soon she pushes her changes to the server<\/li><\/ul>\n\n\n\n<p><strong>What should you use to work with a local Git Repository and a centralized TFS source control repository?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Git Source Control Provider<\/li><li><strong>Git-TF (Ans)<\/strong><\/li><li>Visual Studio Git Extensions<\/li><\/ul>\n\n\n\n<p><strong>To create a Git branch, you must first create it in a shared repository and then copy that branch to your local repository.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>False (Ans)<\/strong><\/li><li>True<\/li><\/ul>\n\n\n\n<p><strong>What version control approaches are used by Centralized Version Control systems?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Check-in\/Check-out<\/li><li>None of the Above<\/li><li>Edit\/Commit<\/li><li><strong>All of the Above (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>If a Pull Request is rejected, can you make code changes and submit a revision?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Yes (Ans)<\/strong><\/li><li>No<\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_90726\"><figure class=\"wp-block-embed wp-block-embed-youtube is-type-video is-provider-youtube epyt-figure\"><div class=\"wp-block-embed__wrapper\"><iframe loading=\"lazy\"  id=\"_ytid_17874\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_90726\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><\/div><\/figure><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>What are the fundamental concepts in Git&#8217;s object model? Commits, trees and leaves Commits, files and branches Commits, tags and branches Commits, snapshots, and references (Ans) What&#8230; <\/p>\n","protected":false},"author":1,"featured_media":8614,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[38],"tags":[5640,1550,5639],"class_list":["post-8582","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","tag-commits","tag-git-interview-questions","tag-object-model"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=8582"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8582\/revisions"}],"predecessor-version":[{"id":25177,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8582\/revisions\/25177"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/8614"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=8582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=8582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=8582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}