*git 好用指令:
> 新增一個 local branch
git branch {name}
> 切換 branch 到 另一個 branch’
git checkout {branch’}
> 刪除特定 local branch
git branch -d {name}
> 查詢遠端的server 位置及名字
git remote -v
> 新增一個遠短 server
git remote add {given_name} URL
> 強迫 reset
git reset –hard {local_sha}
> 把 commit 推到遠端 branch
git push {given_name} {local_branch}: refs/for/{remote_branch}
> 從遠端 branch 拉 code 下來
git pull {given_name} {remote_branch}:{local_branch}
> 當前一個修改已 commit,又想把這次修改跟上一個修改一起 commit
git commit –amend
> 想上 patch 到某個已經 push 出去的 change
git push {given_name} {local_branch}:refs/changes/{change_id}
> 查詢某行的歷史
git blame -L [行數] [檔案名]
> 撿別 branch 的 commit 到目前的 branch
git cherry-pick [sha-1]
> output a beautiful format
git log –pretty=format:”%h,%ae,%ar,%s”