Version Control System
- Track History / easy revert
- Collaboration work
VCS Types
CENTRALIZED | DISTRIBUTED |
---|
Subversion (SVN) | Git |
MS Team Fundation Server | Mercurial |
Single Point of Failure | Free, Open Source, Super fast, Scalable |
Scope
Level | | Location |
SYSTEM | All users | C:\ProgramFiles\Git\etc\gitconfig |
GLOBAL | All repos of the current user | ~\.gitconfig |
LOCAL | The current repo | \.git\config |
Windows vs MacOS/Linux
Workflow
Install & set up
https://git-scm.com/download/win
sudo apt update
sudo apt install git
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
git init
git add .
git commit -m "commit message"
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"