git status
git
書き方
git status [-sb] [-uall]何がステージに載り、何がまだかを見せます。追跡外のファイルはフォルダー名にまとめられるので、一つずつ見るには-uallを付けます。
よく使うオプション
| オプション | 意味 |
|---|---|
| -s | short two-column format |
| -b | show the branch line, used as -sb |
| -uall | list untracked files one by one instead of folding folders |
| --ignored | also list what .gitignore hides |
| -v | append the staged diff |
| --porcelain | stable machine format for scripts |
例
git status -sbone line per change plus the branch and its upstream
git status -uallnames every untracked file inside new folders
git status --porcelainoutput a script can parse without surprises
取り消しに何通りもあるのが混乱のもとです — ブランチの指す先を動かすのと、打ち消すコミットを積むのは別です。
読み方
- 角括弧 [ ] は省いてよい部分です。
- 三点 … は複数並べられるという意味です。
- オプションは大文字小文字を区別します — -r と -R が別物のコマンドもあります。
よくある質問
Q. git status は何をしますか。
何がステージに載り、何がまだかを見せます。追跡外のファイルはフォルダー名にまとめられるので、一つずつ見るには-uallを付けます。
Q. どう打ちますか。
git status [-sb] [-uall] — 角括弧は省いてよい部分です。
Q. よく使うオプションはいくつですか。
ここにまとめたのは6個です。全部は man git にあります。このコマンドはgitの仲間です。
関連するコマンド
man ページ: man git-status