Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-status(1) |
| 2 | ============= |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | 7c73c66 | 2007-01-19 00:37:50 | [diff] [blame] | 6 | git-status - Show the working tree status |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | 8fd5230 | 2006-08-10 00:18:08 | [diff] [blame] | 11 | 'git-status' <options>... |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 12 | |
| 13 | DESCRIPTION |
| 14 | ----------- |
Junio C Hamano | 942b35e | 2007-12-09 10:19:33 | [diff] [blame^] | 15 | Displays paths that have differences between the index file and the |
| 16 | current HEAD commit, paths that have differences between the working |
| 17 | tree and the index file, and paths in the working tree that are not |
| 18 | tracked by git (and are not ignored by gitlink:gitignore[5]). The first |
| 19 | are what you _would_ commit by running `git commit`; the second and |
| 20 | third are what you _could_ commit by running `git add` before running |
| 21 | `git commit`. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 22 | |
Junio C Hamano | 8fd5230 | 2006-08-10 00:18:08 | [diff] [blame] | 23 | The command takes the same set of options as `git-commit`; it |
| 24 | shows what would be committed if the same options are given to |
| 25 | `git-commit`. |
| 26 | |
Junio C Hamano | 942b35e | 2007-12-09 10:19:33 | [diff] [blame^] | 27 | If there is no path that is different between the index file and |
| 28 | the current HEAD commit (i.e., there is nothing to commit by running |
| 29 | `git-commit`), the command exits with non-zero status. |
| 30 | |
Junio C Hamano | b515b6a | 2007-08-08 09:21:16 | [diff] [blame] | 31 | If any paths have been touched in the working tree (that is, |
| 32 | their modification times have changed) but their contents and |
| 33 | permissions are identical to those in the index file, the command |
| 34 | updates the index file. Running `git-status` can thus speed up |
| 35 | subsequent operations such as `git-diff` if the working tree |
| 36 | contains many paths that have been touched but not modified. |
| 37 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 38 | |
| 39 | OUTPUT |
| 40 | ------ |
| 41 | The output from this command is designed to be used as a commit |
Junio C Hamano | 942b35e | 2007-12-09 10:19:33 | [diff] [blame^] | 42 | template comment, and all the output lines are prefixed with '#'. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 43 | |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 44 | The paths mentioned in the output, unlike many other git commands, are |
Junio C Hamano | 942b35e | 2007-12-09 10:19:33 | [diff] [blame^] | 45 | made relative to the current directory if you are working in a |
| 46 | subdirectory (this is on purpose, to help cutting and pasting). See |
| 47 | the status.relativePaths config option below. |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 48 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 49 | |
Junio C Hamano | f9771f6 | 2007-01-17 17:42:30 | [diff] [blame] | 50 | CONFIGURATION |
| 51 | ------------- |
| 52 | |
| 53 | The command honors `color.status` (or `status.color` -- they |
| 54 | mean the same thing and the latter is kept for backward |
| 55 | compatibility) and `color.status.<slot>` configuration variables |
| 56 | to colorize its output. |
| 57 | |
Junio C Hamano | 942b35e | 2007-12-09 10:19:33 | [diff] [blame^] | 58 | If the config variable `status.relativePaths` is set to false, then all |
| 59 | paths shown are relative to the repository root, not to the current |
| 60 | directory. |
| 61 | |
Junio C Hamano | 679d22d | 2007-06-02 21:13:44 | [diff] [blame] | 62 | See Also |
| 63 | -------- |
| 64 | gitlink:gitignore[5] |
Junio C Hamano | f9771f6 | 2007-01-17 17:42:30 | [diff] [blame] | 65 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 66 | Author |
| 67 | ------ |
| 68 | Written by Linus Torvalds <torvalds@osdl.org> and |
| 69 | Junio C Hamano <junkio@cox.net>. |
| 70 | |
| 71 | Documentation |
| 72 | -------------- |
| 73 | Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>. |
| 74 | |
| 75 | GIT |
| 76 | --- |
| 77 | Part of the gitlink:git[7] suite |