Commit
git add .
untuk tambahkan semua filegit commit -m "message"
git commit --amend
untuk commit ulang dengan versi terakhirgit rm [file]
git commit --allow-empty -m "Trigger Build"
untuk commit empty commitgit commit -m 'ci: empty commit' --allow-empty && git push && git reset --soft HEAD~ && git push -f
untuk commit empty commit kemudian reset ke last commit agar history-nya tidak rusakgit ammend
dangit push --force-with-lease
untuk merubah commit message,force-with-lease
membantu memeriksa agar dirubah jika tidak ada penambahan commit dari orang lain
Log
git status
git log --oneline
Branch
git branch -l
untuk list branch localgit branch -r
untuk list branch remote
Merge
git rebase -i HEAD~[N]
examplegit rebase -i HEAD~3
for the last 3 commit. And then, choosepick / p
for the old commit to be used as based and other assquash / s
git merge --squash [branch]
to squash all commit from another branch to current branch
Blame
git blame [path] -L 1,4
see who responsible for code in path on line 1-4
Config
git config --list --show-origin
git config core.email
ataugit config --get core.email
ataugit config --get-all core.email
git config --get-regexp core.*
git config core.name [name]
ataugit config --global core.name [name]
untuk set