R's Workshop

List Branches Match a Patern and Show Author of Last Commit

看到一個蠻有卻的寫法, 可以列出所有 remote branch 的 last commit 的 author name 和 date for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ai by %an" $branch | head -n 1` \\t$branch; done Read more

Sync Deleted Git Branches between Local and Remote

紀錄 local 和 remote 如何同步刪除 git branch Read more

Create Linux User and Assign Group via Command Line

紀錄一下如何透過 command line 建立 linux user Read more

Git Rebase Onto

Git rebase --onto 指令可把某一段連續的 commits rebase 到新的 parent commit 上. 我通常會用這個方式捨棄當前 branch 和目標 branch 重複但不完全相同的 commits, 避免直接 rebase 時遇到 conflict. Read more

Push Git Branch to Remote and Set upstream

把 local 的 branch push 到 remote 後, 通常也會同步設定將 local 的 branch 的 upstream 設成 remote branch. 這樣之後 fetch/pull 時就會自動更新. 以下紀錄作法. Read more