Más contenido relacionado
La actualidad más candente (20)
Similar a テーマ別Git tips (20)
テーマ別Git tips
- 2. 自己紹介
• 出川幾夫 (Degawa, Ikuo)
• 慶應大学院理工学研究科 M2
• スローガンでインターンしてます(エンジニア
• 15年からレバレジーズに勤務
• Apple信者
• 好きなアイドル:東條希
Twitter @ikuwow
Facebook: hashiki.ikuwow
- 17. git reflog:
HEADの指してきたコミットの履歴を
見る
$ git reflog
48585a2 HEAD@{0}: commit: phpのパスを変更、php53に
2faa5b5 HEAD@{1}: commit (merge): merged.
bb8e098 HEAD@{2}: checkout: moving from lablab to master
df46799 HEAD@{3}: checkout: moving from master to lablab
bb8e098 HEAD@{4}: commit: vim-fugitiveをインストール
c72ed79 HEAD@{5}: clone: from ssh://git@ikuwow.com:26457/home/git/
repos/dotfiles.git
- 26. git grep [文字列]
• git管理下のファイルの全ての行を検索して、
指定の文字のある行を表示させる
• Unixコマンドのgrepの拡張
• Unixコマンドのgrepより圧倒的に早い!
- 27. git grep
$ git grep -n navbar # “navbar”を行を検索、表示
!
# 行番号をデフォルトで表示させたいならこれ
$ git config --global grep.lineNumber true
!
$ git grep -n -C 3 navbar # -Cでマッチした行の上下3行まで表示
!
- 33. その他 git stash
$ git stash list
!
$ git stash pop
!
$ git stash apply
!
$ git stash drop 2faa5b5
!
$ git stash clear
- 40. まとめ
• git reset
• git blame
• git grep
• git stash
• git filter-branch, git push -f