Created
April 8, 2016 20:59
-
-
Save willeccles/224c3c728745f576a086cda8bce11750 to your computer and use it in GitHub Desktop.
A few git-related methods for PowerShell.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set up the github profile, as outlined in the profile itself. | |
# this will only work if you have installed github desktop | |
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1") | |
clear | |
#on this line I run archeyjs, but I removed that here. | |
# define your github folder path | |
$gitfolder="C:\path\to\github\folder" | |
# this one is clear | |
function up { | |
cd "../"; | |
} | |
# get to C:\ | |
function root { | |
cd "$env:HOMEDRIVE\"; | |
} | |
# get to the github folder in two strokes | |
function g { | |
cd $gitfolder | |
} | |
# go to the user home folder (would be 'cd ~/' on linux) | |
function home { | |
cd "$env:HOMEPATH" | |
} | |
# clone a repo under my name OR optionally add a user | |
# obviously this is github-only, modify as-needed to other platforms | |
function gitc($repo, $user="willeccles") { | |
git clone "https://github.com/$user/$repo" | |
} | |
# to remind myself every time i open PS | |
write-host "Use '" -nonewline -foregroundcolor gray; write-host "g" -nonewline -foregroundcolor green; write-host "' to get to the github directory." -foregroundcolor gray |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment