Git and PowerShell Environment Setup Notes

As a visually oriented developer, I remain command-line challenged. And yet there are some things that seem to be more productive in command-line form, and git seems to be one of them. I’ve not tried every GUI incarnation of a git tool, so I would be happy to be proven wrong about that. Until then, here are my notes on setting up my local machine with Git and PowerShell.

1. Download and install GitHub for Windows from https://windows.github.com/.

2. Create this directory: {home}\Documents\WindowsPowerShell

3. Add this file: profile.ps1 with these lines:

  • $env:path += ";" + (Get-Item "Env:ProgramFiles(x86)").Value + "\Git\bin"
  • $env:PSModulePath = $env:PSModulePath + ";{home}\Documents\WindowsPowerShell\Modules"

Where {home} is your user home directory.

4. Run PowerShell as Admin with following three commands (individually):

5. In PS, navigate to a local git repository directory. And let the magic begin.

6. Review http://think-like-a-git.net/ for a refresher.

Update: Change colors for better contrast, at least for my eyes.

gitcolor

A. Edit the GitPrompt.ps1 file in {home}\Documents\WindowsPowerShell\Modules\posh-git directory. Delete the “Dark” text from the colors.

B. Edit the .gitconfig file in the {home}\ directory and add the following lines to taste:

[core]
  quotepath = false
  whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
[color]
  diff = auto
  status = auto
  branch = auto
  interactive = auto
  ui = true
  pager = true
[color "branch"]
  current = yellow bold
  local = yellow
  remote = red
[color "diff"]
  meta = yellow bold
  frag = red bold
  old = red reverse
  new = green reverse
  whitespace = white reverse
[color "status"]
  added = yellow
  changed = green
  untracked = cyan reverse
  branch = red

Thanks and credit to many sources for coloring, but in particular to David DeSandro.

Mischief Managed-Aligning Blog with GitHub and NuGet

For about a year and a half I’ve been working on various open source projects published on GitHub and several of them have packages on NuGet. When I first set them up, I used the name “duovia” which was the name of a little S corp I use from time to time for corp-to-corp consulting projects. But the name was just causing confusion for anyone looking me up and checking out my open source projects.

So I set out to simplify things a bit all around the name “tylerjensen.” I hope This will make it easier for people to find my work and less confusing when they do.