@matheusbsbs / matheus-bagliano / commits / 11920d28da
Fork 0

Add a built-in alias for 'stage' to the 'add' command

This comes from conversation at the GitTogether where we thought it would be helpful to be able to teach people to 'stage' files because it tends to cause confusion when told that they have to keep 'add'ing them. This continues the movement to start referring to the index as a staging area (eg: the --staged alias to 'git diff'). Also adds a doc file for 'git stage' that basically points to the docs for 'git add'. Signed-off-by: Scott Chacon <schacon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Scott Chacon committed Dec 1, 2008 at 22:14 UTC 11920d28da1ac1b65eb4041c1b7355924e5d1366
2 files changed +20
Documentation/git-stage.txt new
+19
@@ -0,0 +1,19 @@
1 +git-stage(1)
2 +==============
3 +
4 +NAME
5 +----
6 +git-stage - Add file contents to the staging area
7 +
8 +
9 +SYNOPSIS
10 +--------
11 +[verse]
12 +'git stage' args...
13 +
14 +
15 +DESCRIPTION
16 +-----------
17 +
18 +This is a synonym for linkgit:git-add[1]. Please refer to the
19 +documentation of that command.
git.c
+1
@@ -266,6 +266,7 @@ static void handle_internal_command(int argc, const char **argv)
266 const char *cmd = argv[0];
267 static struct cmd_struct commands[] = {
268 { "add", cmd_add, RUN_SETUP | NEED_WORK_TREE },
269 + { "stage", cmd_add, RUN_SETUP | NEED_WORK_TREE },
270 { "annotate", cmd_annotate, RUN_SETUP },
271 { "apply", cmd_apply },
272 { "archive", cmd_archive },