- Working directory
- Index
- Repository
- Stash
git add filename
git diff view different between working dir and index
git status
git commit -m "Commit message"
git diff --cached view different between index and repository
git status
git push
git branch
git diff lisa master
git checkout lisa
git rm --cached filename
rm filename
rm menu.txt menu.md
git add menu.md
git add menu.txt
git mv menu.md menu.txt
git cat-file -p master
tree 6cbc48cf00a9624a2cc43f6d88fba2be0ed9dbd8
parent 9c63593b06cc9331eedbcc7e503ef1aa96724f6a
author sandyverden [email protected] 1586099087 +0700
committer sandyverden [email protected] 1586099087 +0700
rename to README.d
git cat-file -p 6cbc48cf00a9624a2cc43f6d88fba2be0ed9dbd8
100644 blob def3e5bfebc06f2f77d55b9fbb098522101098a4 README.md
100644 blob 3dff7cd890f0adf75fe98e8513df416cf38ee931 menu.txt
040000 tree 5ac651563e6b6cd406fe095903dab7fc5c7135ae recipes
git cat-file -p 3dff7cd890f0adf75fe98e8513df416cf38ee931
Spaghetti alla Carbonara
Apple Pie
Cheesecake
Chicken Tikka Masala
Nasi Goreng
mie goreng
git merge sandi-dev
git checkout sandi-dev
git rebase master
git tag rebase
git fetch
git pull
ssh-keygent
Use passphrase to secure private key
Copy from Repository to index and working directory
git reset --hard 'commit hash checkpoint' git reset --hard b88df3218af2d87a5120f4544f70e02e2ee249a0 git reset HEAD README.md
reset only menu file git checkout HEAD README.md restore to last commit
Copy from repository to index
Left it in repository
git stash
Stash like clipboard of your project
Default stash only save tracked file (file in index storage) use --include-untracked to save all file git stash --include-untracked
git stash list
Check git stash list git stash apply
Restore file in stash to working directory or Index storage git stash clear
Clear/remove file in stash storage
git log --graph --decorate --oneline
git show HEAD git show HEAD^ git show HEAD~2
git blame