Skip to content

Instantly share code, notes, and snippets.

@raelyard
Last active October 26, 2020 03:30
Show Gist options
  • Save raelyard/a274f24e7448211e313f427256874e37 to your computer and use it in GitHub Desktop.
Save raelyard/a274f24e7448211e313f427256874e37 to your computer and use it in GitHub Desktop.
Git/GitHub Course - Remote 2020-10

Course Outline:

  • Part 1: Git
    • Getting Started with Git and GitHub
    • Basic Git Commands
    • Advanced Git Commands
  • Part 2: GitHub
    • Getting Started with GitHub
    • Options for Teams
    • Working in Teams

Lab repository:

https://github.com/techtown-training/git-github-boot-camp

Excellent blog post, written by one of the founders of GitHub, on what Git is and why it is the way it is.

https://tom.preston-werner.com/2009/05/19/the-git-parable.html

Visual Studio Code as editor:

git config --global core.editor "code --wait --new-window"

In Powershell, for slick formatting of the prompt with Git status information, I use a tool called PoshGit

choco install -y poshgit

My Git config I apply when I set up a new machine

(from https://gist.github.com/raelyard/6783972a17ba1bc14e83):

# configure git identity and defaults (want to prune on fetch, etc.)
git config --global user.name "Dave Rael"
git config --global user.email "[email protected]"
git config --global fetch.prune true

# make WinMerge my git difftool tool of choice
git config --global diff.tool "winmerge"
git config --global difftool.prompt "false"
git config --global difftool.winmerge.cmd 'winmergeu.exe -e -u -x -wl -dl base \"$LOCAL\" \"$REMOTE\"'

# but also set config to switch to other difftool/mergetool options to switch when desired
git config --global difftool.vsdiffmerge.cmd '\"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsdiffmerge.exe\" \"$LOCAL\" \"$REMOTE\" //t'
git config --global mergetool.vsdiffmerge.cmd '\"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsdiffmerge.exe\" \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\" //m'

# useful git log alias
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr - %cd) %C(bold blue)<%an>%Creset' --abbrev-commit --date local"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment