Link Search Menu Expand Document


Commit - snapshot


git init - initialize dir with git

Staging Area

git add <file> <file> - add file to index
git add . - add all files
git status - list modifications
git rm file.txt - remove a file


git commit -m "message" - commit
git log - See all commit
git checkout master or <commit-hash> - Go back to the latest or specified commit
git reset HEAD -- <file or folder> - Remove a file/folder from staging area


git branch - list all branch
git branch <new-branch-name> - create new branch
git checkout <branch-name> or master - switch to branch-name / master
git merge <branch-name> - merge branch-name into current branch
git branch -d <branch-name> - delete a branch



git remote add REPO https://URL - add remote repo
git remote remove REPO - remove repo
git remote -v - check connected git


git clone - copy latest repo from remote
git push - push to remote
git pull - pull latest from remote

Copyright since 2020 © Chouffy. This work is licensed under CC BY 4.0.