Skip to content

Instantly share code, notes, and snippets.

@eduardoalba
Last active May 8, 2020 20:36
Show Gist options
  • Save eduardoalba/65ccd5fec88865aebcae82cf9ce73ac1 to your computer and use it in GitHub Desktop.
Save eduardoalba/65ccd5fec88865aebcae82cf9ce73ac1 to your computer and use it in GitHub Desktop.
My compilation of git links and commands

Links

Official git cheat sheet
https://github.github.com/training-kit/downloads/github-git-cheat-sheet/

Pro Git book (for free 🙂)
https://git-scm.com/book/en/v2

Git configurtion files
https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup https://www.onwebsecurity.com/configuration/git-on-windows-location-of-global-configuration-file.html


Commands

$ git config --list [--show-origin]

Lists all git config variables and its location.
These variables can be stored in three different places. (local, system and global)

$ git merge --squash <<branch>>

Summarizes all commits from <<>> in a single commit

Visual Studio Code

$ git config --global -e

Configures VS Code as default tool. Just copy below content on .gitconfig

[core]
    editor = code --wait
[merge]
    tool = vscode
[mergetool "vscode"]
    cmd = code --wait $MERGED
[diff]
    tool = vscode
[difftool "vscode"]
    cmd = code --wait --diff $LOCAL $REMOTE


 $ git mergetool
 $ git difftool

Calls diff/merge tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment