その日にコミットしたタイトルとリポジトリ(GitHub)のURLを簡単に取得できるようにしました。
以下のような形式で取得できます。
vimのタグ設定
https://github.com/shoyan/dotfiles/commit/ee2634b83e6cb2f0d8294b20af362beedf46837c
行末選択しやすくする
https://github.com/shoyan/dotfiles/commit/9480b8392a95c133edf69185c3da777ae62f268d
branchをbrで使えるように
https://github.com/shoyan/dotfiles/commit/b881ab093ed929b1731f1978fbf7dbfcde4cbf36
compareコマンド追加
https://github.com/shoyan/dotfiles/commit/01fb7d644312bc0e86a7f646292c2de2e7e0e18a
設定方法
~/.bashrcに以下を記述してください。
.bashrc
function seika {
local URL="$(git remote -v | head -n 1 | sed -e 's|.*git@\(.*\):\(.*\)\.git.*|https://\1/\2|g')"; git log --pretty="%s \n $URL/commit/%H" --author="$(git config --get user.name)" --since=1.days | sed 's/\\n/\
/g'
}
実行方法
コミットログを取得したいGitのワーキングディレクトリで以下のコマンドを入力します。
$ seika