git on windows
Using Git on Windows has become incredibly simple these days thanks to the efforts of GitHub’s Windows team (haacked, ammeep, shiftkey, half-ogre, tclem and likely many others). For the majority of people installing GitHub for Windows will be good enough. But if you’re like me you want a customized console to perform builds, work with git, etc. The following is a reminder to myself short guide on how I configured my current setup.
Install the wares
Configure your wares
GitHub for Windows
- Login to the App
- Configure your git settings (name and email)
- Ensure PowerShell is the Default Shell
ConsoleZ
- Download ConsoleZ and extract to
C:\Program Files(x86)\ConsoleZ\
assuming you’re on a x64 system - Right-click
Console.exe
and Run as administrator - Press Ctrl + S to open Settings
- Under Console -> Shell put
%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe
- Optionally set a Startup Directory
- Under Appearance -> Check Save on exit for both Size and Position
- Under Behavior -> Copy & Paste check Copy on Select
- Under Hotkeys
- Change Copy selection to Ctrl+C
- Change Paste to Ctrl+C
- Under Hotkeys -> Mouse
- Change Select Text to Left (without Shift)
- Change Paste Text to Right
- Change Context Menu #1 to Shift + Right
- Press Ok to save your changes
- Pin
Console.exe
to your Taskbar (optional)
Configure Powershell
Inside you the Console window you have open from the previous step:
- Execute this command
Set-ExecutionPolicy RemoteSigned
- read about this here
Execute Test-path $profile
- If this prints
False
executeNew-item –type file –force $profile
- If this prints
- Execute $profile
- Copy the output of this command (you’ll need it for the next section)
Configure your Powershell Profile
- Open your favorite text editor (checkout atom)
- File -> Open -> Paste the path you copied in the previous step
- Paste in the following (editing as appropriate):
#Let GH4W do magic
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1")
. $env:github_posh_git\profile.example.ps1
Set-Alias g git.exe
Save the file and reload reload the console and you’re done.
Summary
You now have a functional console that executes PowerShell, doubles as a Visual Studio Command Prompt and is fully configured for Git using your GitHub credentials. 💥
- development
- git
- windows