{"id":5974,"date":"2018-05-11T11:11:31","date_gmt":"2018-05-11T15:11:31","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=5974"},"modified":"2018-05-11T11:11:31","modified_gmt":"2018-05-11T15:11:31","slug":"get-git-configuration-with-powershell","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/","title":{"rendered":"Get Git Configuration with PowerShell"},"content":{"rendered":"<p>A few weeks ago I was teaching a PowerShell fundamentals course. Towards the end of the week we start creating simple scripts and functions. One night after class I was thinking about giving them another example and I was working on a project using <em>git<\/em>. At some point I was looking at my <em>git<\/em> configuration when I realized the output was structured text that could easily be turned into PowerShell output, that is, objects. So I whipped up a quick function to convert text output from <em>git<\/em> to a traditional PowerShell function that writes objects to the pipeline.<\/p>\n<p><!--more--><\/p>\n<p>Now, I realize there are a number of PowerShell modules and tools available for working with <em>git<\/em> and I could be re-inventing the wheel. But it met my teaching needs and after a bit more polishing I thought I'd share it.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">#requires -version 5.0\r\n\r\nFunction Get-GitConfig {\r\n\r\n&lt;#\r\n.SYNOPSIS\r\n    Get git configuration settings\r\n.DESCRIPTION\r\n    Git stores configurations settings in a simple text file format. Fortunately, this file is structured and predictable. This command will process git configuration information into PowerShell friendly output.\r\n.PARAMETER Scope\r\n    Possible values are Global,Local or System\r\n.PARAMETER Path\r\n    Enter the path to a .gitconfig file. You can use shell paths like ~\\.gitconfig\r\n.EXAMPLE\r\nPS C:\\&gt; Get-GitConfig\r\n   \r\nScope  Category  Name         Setting\r\n-----  --------  ----         -------\r\nglobal filter    lfs          git-lfs clean -- %f\r\nglobal filter    lfs          git-lfs smudge -- %f\r\nglobal filter    lfs          true\r\nglobal user      name         Art Deco\r\nglobal user      email        artd@company.com\r\nglobal gui       recentrepo   C:\/Scripts\/Gen2Tools\r\nglobal gui       recentrepo   C:\/Scripts\/PSVirtualBox\r\nglobal gui       recentrepo   C:\/Scripts\/FormatFunctions\r\nglobal core      editor       powershell_ise.exe\r\nglobal core      autocrlf     true\r\nglobal core      excludesfile ~\/.gitignore\r\nglobal push      default      simple\r\nglobal color     ui           true\r\nglobal alias     logd         log --oneline --graph --decorate\r\nglobal alias     last         log -1 HEAD\r\nglobal alias     pushdev      !git checkout master &amp;&amp; git merge dev &amp;&amp; git push &amp;&amp; git checkout dev\r\nglobal alias     st           status\r\nglobal alias     fp           !git fetch &amp;&amp; git pull\r\nglobal merge     tool         kdiff3\r\nglobal mergetool kdiff3       'C:\/Program Files\/KDiff3\/kdiff3.exe' $BASE $LOCAL $REMOTE -o $MERGED\r\n\r\nGetting global configuration settings\r\n\r\n.EXAMPLE\r\nPS C:\\&gt; Get-GitConfig -scope system | where category -eq 'filter'\r\n\r\nScope  Category Name Setting\r\n-----  -------- ---- -------\r\nsystem filter   lfs  git-lfs clean -- %f\r\nsystem filter   lfs  git-lfs smudge -- %f\r\nsystem filter   lfs  git-lfs filter-process\r\nsystem filter   lfs  true\r\n\r\nGet system configuration and only git filters.\r\n\r\n.EXAMPLE\r\nPS C:\\&gt; Get-GitConfig -path ~\\.gitconfig | format-table -groupby category -property Name,Setting\r\n\r\nGet settings from a configuration file and present in a grouped, formatted table.\r\n\r\n.INPUTS\r\n    none\r\n.OUTPUTS\r\n    [pscustomobject]\r\n.NOTES\r\n    The command assumes you have git installed. Otherwise, why would you be using this?\r\n\r\n    Last updated: 11 May, 2018\r\n.LINK\r\n    git\r\n#&gt;\r\n\r\n    [CmdletBinding(DefaultParameterSetName = \"default\")]\r\n    [OutputType([PSCustomObject])]\r\n    Param (\r\n        [Parameter(Position = 0, ParameterSetName = \"default\")]\r\n        [ValidateSet(\"Global\", \"System\", \"Local\")]\r\n        [string[]]$Scope = \"Global\",\r\n        [Parameter(ParameterSetName = \"file\")]\r\n        #the path to a .gitconfig file which must be specified if scope if File\r\n        [ValidateScript( {Test-Path $_})]\r\n        [Alias(\"config\")]\r\n        [string]$Path\r\n    )\r\n    \r\n    Begin {\r\n        Write-Verbose \"Starting $($myinvocation.MyCommand)\"\r\n        if ($path) {\r\n            #convert path value to a complete file system path\r\n            $Path = Convert-Path -Path $path\r\n        }\r\n        #internal helper function\r\n        function _process {\r\n            [cmdletbinding()]\r\n            Param(\r\n                [scriptblock]$scriptblock,\r\n                [string]$Scope\r\n            )\r\n\r\n            Write-Verbose \"Invoking $($scriptblock.tostring())\"\r\n            #invoke the scriptblock and save the text output\r\n            $data = Invoke-Command -scriptblock $scriptblock\r\n        \r\n            #split each line of the config on the = sign\r\n            #and add to the hashtable\r\n            foreach ($line in $data) {\r\n                $split = $line.split(\"=\")\r\n                #split the first element again to get the category and name\r\n                $sub = $split[0].split(\".\")\r\n                [PSCustomObject]@{\r\n                    Scope    = $scope\r\n                    Category = $sub[0]\r\n                    Name     = $sub[1]\r\n                    Setting  = $split[1]\r\n                }\r\n            } #foreach line\r\n        } # _process\r\n    } #begin\r\n    \r\n    Process {\r\n\r\n        if ($PSCmdlet.ParameterSetName -eq 'file') {\r\n            Write-Verbose \"Getting config from $path\"\r\n            $get = [scriptblock]::Create(\"git config --file $path --list\")\r\n            #call the helper function\r\n            _process -scriptblock $get -scope \"File\"\r\n                        \r\n        }\r\n        else {\r\n            foreach ($item in $Scope) {\r\n                Write-Verbose \"Getting $item config\"\r\n                #the git command is case sensitive so make the scope\r\n                #lower case\r\n                $item = $item.tolower()\r\n\r\n                #create a scriptblock to run git config\r\n                $get = [scriptblock]::Create(\"git config --$item --list\")\r\n        \r\n                #call the helper function\r\n                _process -scriptblock $get -Scope $item\r\n           \r\n            } #foreach scope\r\n        } #else\r\n    } #process\r\n    \r\n    End {\r\n        Write-Verbose \"Ending $($myinvocation.MyCommand)\"\r\n    } #end\r\n\r\n} #end Get-GitConfig\r\n\r\n#add an optional alias\r\nSet-Alias -Name gcc -Value Get-GitConfig\r\n<\/pre>\n<p>The default behavior is to show your global <em>git<\/em> configuration. But you can specify different scopes. You can also specify the path to a gitconfig file. Because, an object is written to the pipeline you can easily identify different parts of your <em>git<\/em> configuration.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/05\/image.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"image\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/05\/image_thumb.png\" alt=\"image\" width=\"1028\" height=\"598\" border=\"0\" \/><\/a><\/p>\n<p>Once you have a PowerShell command, all sorts of things are possible.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/05\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"margin: 0px; display: inline; background-image: none;\" title=\"image\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/05\/image_thumb-1.png\" alt=\"image\" width=\"1028\" height=\"598\" border=\"0\" \/><\/a><\/p>\n<p>If you are a <em>git<\/em> user I hope you'll grab a copy of the function and let me know what you think.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few weeks ago I was teaching a PowerShell fundamentals course. Towards the end of the week we start creating simple scripts and functions. One night after class I was thinking about giving them another example and I was working on a project using git. At some point I was looking at my git configuration&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Just posted: Get Git Configuration with #PowerShell","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[521,4],"tags":[519,534,540],"class_list":["post-5974","post","type-post","status-publish","format-standard","hentry","category-git","category-powershell","tag-git","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Get Git Configuration with PowerShell &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get Git Configuration with PowerShell &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"A few weeks ago I was teaching a PowerShell fundamentals course. Towards the end of the week we start creating simple scripts and functions. One night after class I was thinking about giving them another example and I was working on a project using git. At some point I was looking at my git configuration...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2018-05-11T15:11:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/05\/image_thumb.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5974\\\/get-git-configuration-with-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5974\\\/get-git-configuration-with-powershell\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Get Git Configuration with PowerShell\",\"datePublished\":\"2018-05-11T15:11:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5974\\\/get-git-configuration-with-powershell\\\/\"},\"wordCount\":224,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5974\\\/get-git-configuration-with-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/05\\\/image_thumb.png\",\"keywords\":[\"Git\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"Git\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5974\\\/get-git-configuration-with-powershell\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5974\\\/get-git-configuration-with-powershell\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5974\\\/get-git-configuration-with-powershell\\\/\",\"name\":\"Get Git Configuration with PowerShell &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5974\\\/get-git-configuration-with-powershell\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5974\\\/get-git-configuration-with-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/05\\\/image_thumb.png\",\"datePublished\":\"2018-05-11T15:11:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5974\\\/get-git-configuration-with-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5974\\\/get-git-configuration-with-powershell\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5974\\\/get-git-configuration-with-powershell\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/05\\\/image_thumb.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/05\\\/image_thumb.png\",\"width\":1028,\"height\":598},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5974\\\/get-git-configuration-with-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Git\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/git\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get Git Configuration with PowerShell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Get Git Configuration with PowerShell &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Get Git Configuration with PowerShell &#8226; The Lonely Administrator","og_description":"A few weeks ago I was teaching a PowerShell fundamentals course. Towards the end of the week we start creating simple scripts and functions. One night after class I was thinking about giving them another example and I was working on a project using git. At some point I was looking at my git configuration...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/","og_site_name":"The Lonely Administrator","article_published_time":"2018-05-11T15:11:31+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/05\/image_thumb.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Get Git Configuration with PowerShell","datePublished":"2018-05-11T15:11:31+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/"},"wordCount":224,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/05\/image_thumb.png","keywords":["Git","PowerShell","Scripting"],"articleSection":["Git","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/","name":"Get Git Configuration with PowerShell &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/05\/image_thumb.png","datePublished":"2018-05-11T15:11:31+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/05\/image_thumb.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/05\/image_thumb.png","width":1028,"height":598},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5974\/get-git-configuration-with-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Git","item":"https:\/\/jdhitsolutions.com\/blog\/category\/git\/"},{"@type":"ListItem","position":2,"name":"Get Git Configuration with PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":6492,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6492\/creating-more-git-powershell-tools\/","url_meta":{"origin":5974,"position":0},"title":"Creating More Git PowerShell Tools","author":"Jeffery Hicks","date":"February 1, 2019","format":false,"excerpt":"I have received a tremendous amount of interest in my recent articles on creating a git sizing tool using PowerShell. Many of you were savvy enough to realize the journey I was describing was just as important as the destination. With that in mind, I decided to revisit another PowerShell\u2026","rel":"","context":"In &quot;Git&quot;","block_context":{"text":"Git","link":"https:\/\/jdhitsolutions.com\/blog\/category\/git\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-3.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-3.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-3.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-3.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":5121,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5121\/friday-fun-find-a-git-tip-with-powershell\/","url_meta":{"origin":5974,"position":1},"title":"Friday Fun: Find a Git Tip with PowerShell","author":"Jeffery Hicks","date":"June 24, 2016","format":false,"excerpt":"Recently I published a PowerShell function that I use to display a random Git Tip of the Day. The function relies on my clone of the Git-Tips project on GitHub. I've been keeping tabs on this project and a question was posed about creating a command line utility to search\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"finding a git tip with PowerShell","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-20.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-20.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-20.png?resize=525%2C300 1.5x"},"classes":[]},{"id":6465,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6465\/keeping-git-in-check-with-powershell\/","url_meta":{"origin":5974,"position":2},"title":"Keeping Git in Check with PowerShell","author":"Jeffery Hicks","date":"January 28, 2019","format":false,"excerpt":"Last week on Twitter I saw a discussion about a git related problem. The short version of the story is that the person was running out of disk space and didn't understand why. Turns out this person has several development projects using git. All of the change tracking and other\u2026","rel":"","context":"In &quot;Git&quot;","block_context":{"text":"Git","link":"https:\/\/jdhitsolutions.com\/blog\/category\/git\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-26.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-26.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-26.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-26.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":5132,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5132\/downloading-git-tips-with-powershell\/","url_meta":{"origin":5974,"position":3},"title":"Downloading Git Tips with PowerShell","author":"Jeffery Hicks","date":"June 27, 2016","format":false,"excerpt":"So I've been sharing a number of PowerShell tools I've created for working with Git, including a few for getting tips from the Git Tips project on GitHub. My initial work was based on the fact that I had a local clone of that repository and wanted to search the\u2026","rel":"","context":"In &quot;Git&quot;","block_context":{"text":"Git","link":"https:\/\/jdhitsolutions.com\/blog\/category\/git\/"},"img":{"alt_text":"getting all online git tips with PowerShell","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-22.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-22.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-22.png?resize=525%2C300 1.5x"},"classes":[]},{"id":4999,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4999\/finding-git-repositories-with-powershell\/","url_meta":{"origin":5974,"position":4},"title":"Finding Git Repositories with PowerShell","author":"Jeffery Hicks","date":"May 18, 2016","format":false,"excerpt":"As part of my ongoing improvement process this year I am starting to use Git much more. Yesterday I posted an article with my PowerShell script to create a new project folder which includes creating a Git repository. My challenge has been that I don't always remember what I have\u2026","rel":"","context":"In &quot;Git&quot;","block_context":{"text":"Git","link":"https:\/\/jdhitsolutions.com\/blog\/category\/git\/"},"img":{"alt_text":"find git repositories with PowerShell","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/05\/image_thumb-1.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/05\/image_thumb-1.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/05\/image_thumb-1.png?resize=525%2C300 1.5x"},"classes":[]},{"id":5112,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5112\/creating-git-commit-messages-with-powershell\/","url_meta":{"origin":5974,"position":5},"title":"Creating Git Commit Messages with PowerShell","author":"Jeffery Hicks","date":"June 21, 2016","format":false,"excerpt":"As part of my process of learning an using Git I am trying to get in the habit of using meaningful commit messages. Sure, you can get by with a single line comment which is fine when running git log --oneline. But you can use a multi-line commit message. However,\u2026","rel":"","context":"In &quot;Git&quot;","block_context":{"text":"Git","link":"https:\/\/jdhitsolutions.com\/blog\/category\/git\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-19.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-19.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-19.png?resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=5974"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5974\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=5974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=5974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=5974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}