Skip to content

Github

Cheatsheets

  1. git folder
git init

source_code
folder

  1. git log & checkout
git log
git log -3

git checkout c0a1dd1fd1a22e272532312930965a3054988d2a
git checkout c0a1dd1fd1a22e272532312930965a3054988d2a data2.txt
# back to last edited
git checkout <branch_name>
3. branch

git branch branch1
git branch branch2
git log
git log --all --decorate --oneline --graph
alias graph="git log --all --decorate --oneline --graph"
graph
git checkout <nama_branch>
  1. merge

Fast forward

git merge branch1

hapus branch

git branch --merged
git branch -d branch1

delete tanpa merge

git branch -D branch1

Three-way Merge

git merge branch2

lalu ada pesan commit (membuka editor baru), lalu save & quit

  1. push branch
git push origin branch1
  1. config
git config --global user.name "<user_name_github>"
git config --global user.email "<user_email_github>"