Skip to content
Sven Flickinger edited this page Dec 8, 2020 · 7 revisions

Table of Contents

Setup

For the MaibornWolff Git Cchool we're using this repository as base for getting familiar with git.
We'll use Git via the terminal in the first place and Visual Studio Code for editing files and as Git's default editor.

Git Setup

Linux

  • Install Git using your favorite package manager (e.g. apt):

    $ apt install git-all
    

macOS

Git should be installed if you installed the XCode Command Line Tools. This however does not install the latest version but an Apple specific one.

  • To install the latest version, you can use brew:

    $ brew install git
    

Windows

  • Download Git from git-scm.com.
  • During the installation process, keep all the default settings.

Visual Studio Code (VSCode) Setup

Linux

macOS

  • Download and install VSCode from code.visualstudio.com.
  • Install the shell command
    • In VSCode open the Command Palette (Cmd+Shift+P)
    • Type "shell command" and select Shell Command: Install 'code' command in PATH

Windows

  • Download and install VSCode from code.visualstudio.com.
  • Set Git Bash as Default Shell in VSCode
    • In VSCode open the Command Palette (Ctrl+Shift+P)
    • Type "default shell" and select Terminal: Select Default Shell
    • Pick Git Bash from the list of available shells

Use VSCode as Git's default editor

If not otherwise set, Git's default editor is vim. You can change to VSCode if you're not familiar with git:

  • Open up a terminal (on Windows use Git Bash)
    $ git config --global core.editor "code --wait"
    
  • Verify the settings by running the following command. This should open up a tab in VSCode and wait for the file to be closed before continuing
    $ git config --global -e
    hint: Waiting for your editor to close the file...