How to revert git --amend commad?

1. use `git reflog` to see when did the ammend action happend, let's say it happened at HEAD@{4} 2. use `git reset --soft HEAD@{4}` 3. r...

Wayne

Git 把分支的分支的改動轉移到 master 上

看到一個發文有附圖的[好文](https://medium.com/@glasses618/不要再-cherry-pick-了-e079d67404d6) 以下引用原文 如果今天有三支 branch:master、staging、feature/b。本來你在開發中的 ...

Wayne

how to commit

一直以來我的 commit 方式就是意識流 commit,想到哪就 commit 到哪,呵呵 原因跟我 code review 的習慣有關,我沒有特別講究 commit 的乾淨度所以我在看 code 的時候基本上會忽略 commit message,直接用從票裡得到的 c...

Wayne

How to keep forked git repo up to dated?

### 1. Clone your fork: git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git ### 2. Add remote from original repository in...

Wayne

Git don't blame, we are asking for context bot blaming people

Nice little trick to avoid blaming mindset ``` ➜ ~ cat .gitconfig [alias] context = blame ```

Wayne

git bisect

debugging 的時候可以使用,原理就是 1. 先找到確定沒有問題的 commit 2. git bisect 會用二分法切換到中間的 commit,然後就可以 test 是否存在相同的 bug,持續使用二分法直到找到有問題的 commit

Wayne

加速 git clone

最近網速慢到快死,尤其是 git clone,竟然不到 10kb/s 所以 google 了一下加速的方法 https://codeyarns.com/2016/01/12/slow-speed-on-git-clone/

Wayne