5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GITチートシート

5
Last updated at Posted at 2014-12-23

Git Blame

該当行がどのコミットで更新されたか確認する

git blame -l <ファイル名>

Git Log

とりあえずはこれ

git log --decorate=full --oneline --graph

履歴からコミットのハッシュ値で検索する

git log -p --all <ファイル名>
/<hash値>

コメントを1行で表示する

git log --pretty=oneline

該当ファイルの変更履歴を見る

git log -p <ファイル名>

一意に認識できる部分までのハッシュ値を表示

git log --abbrev-commit

特定のファイルの履歴を見る

git log filename

Git Status

状態を確認する

git status

Git Add

インタラクティブモードでステージング

git add -i

5: patch
を選択(5かp)

y - 処理中の hunk をステージングします
n - 処理中の hunk をステージングしません
q - 終了します。処理中の hunk およびそれ以降の hunk はステージングしません
a - 処理中の hunk およびそれ以降のファイル中の hunk をステージングします。
d - 処理中の hunk およびそれ以降のファイル中の hunk をステージングしません
g - 処理対象となる(別の) hunk を選択します。
/ - 入力した正規表現にマッチする hunk を検索します
j - 処理中の hunk を保留にし、次の保留されている hunk を表示します
J - 処理中の hunk を保留にし、次の hunk を表示します
k - 処理中の hunk を保留にし、ひとつ前の保留されている hunk を表示します
K - 処理中の hunk を保留にし、ひとつ前の hunk を表示します
s - 現在の hunk を小さい hunk に分割します
e - 現在の hunk を手動で編集します
? - ヘルプを表示します
5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?