Skip to content
Menu
myCloud myCloud

Personal short notes about Cloud

  • XMPie
  • AWS
    • AWS Topics
    • AWS Architecture
    • AWS CLI
    • AWS Health
    • AWS Policies
    • AWS Cost
  • CHEAT SHEETS
myCloud myCloud

Personal short notes about Cloud

CHEAT SHEET – Git

By mikado on September 19, 2022April 1, 2023

Version Control System

  • Track History / easy revert
  • Collaboration work

VCS Types

CENTRALIZEDDISTRIBUTED
Subversion (SVN)Git
MS Team Fundation ServerMercurial
Single Point of FailureFree, Open Source, Super fast, Scalable

Scope

LevelLocation
SYSTEMAll usersC:\ProgramFiles\Git\etc\gitconfig
GLOBALAll repos of the current user~\.gitconfig
LOCALThe current repo\.git\config

Windows vs MacOS/Linux

Workflow

Install & set up

  • Windows
https://git-scm.com/download/win
  • Linux
sudo apt update
sudo apt install git
  • Setup
git config --global user.name "my-name"
git config --global user.email "email@example.com"
git config --list
git config --global credential.helper cache
git config --unset credential.helper 

Commands

  • New project
git init
git add .
git commit -m "commit message"
  • Existing project
git clone <url>
git remote add origin ssh://git@git.domain.tld/repository.git 
git remote -v
git push origin main

Check

git  status
git diff
git show
git log

Branches

git branch -ra   #list branch
git checkout -b develop   #create new branch develop
git checkout -b master
git checkout -b develop
git pull
git merge <branch_name>
git reset
git revert
git tag

Keys

ssh-keygen -t ed25519 -C "me@example.com"
Category: CHEAT SHEETS

Categories

  • AWS (4)
  • AWS Architecture (8)
  • AWS CLI (5)
  • AWS Cost (3)
  • AWS Health (4)
  • AWS Policies (2)
  • AWS Topics (24)
  • CHEAT SHEETS (16)
  • Container (21)
  • Datadog (4)
  • Jenkins (2)
  • Linux (9)
  • Microsoft (7)
  • Python (1)
  • SCRIPTS (9)
  • Terraform (5)
  • XMPie (6)
©2025 myCloud
Click to Copy