git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git checkout: add -t alias for --track

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Apr 23, 2008, 23:04 UTC
Message-ID
<20080423230448.GL4012@genesis.frugalware.org>
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---

Just like 'git checkout -q' is an alias for 'git checkout --quiet', I often type 'git checkout -t -b newname master', then realize I need '--track', but in fact '-t' is not used for anything else, so it can be just a short name for --track.

 Documentation/git-checkout.txt |    2 +-
 builtin-checkout.c             |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index e11cddb..a644173 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -47,7 +47,7 @@ OPTIONS
 	by linkgit:git-check-ref-format[1].  Some of these checks
 	may restrict the characters allowed in a branch name.
 
---track::
+-t, --track::
 	When creating a new branch, set up configuration so that git-pull
 	will automatically retrieve data from the start point, which must be
 	a branch. Use this if you always pull from the same upstream branch
diff --git a/builtin-checkout.c b/builtin-checkout.c
index 7deb504..1a93d13 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -504,7 +504,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 		OPT__QUIET(&opts.quiet),
 		OPT_STRING('b', NULL, &opts.new_branch, "new branch", "branch"),
 		OPT_BOOLEAN('l', NULL, &opts.new_branch_log, "log for new branch"),
-		OPT_SET_INT( 0 , "track",  &opts.track, "track",
+		OPT_SET_INT('t', "track",  &opts.track, "track",
 			BRANCH_TRACK_EXPLICIT),
 		OPT_BOOLEAN('f', NULL, &opts.force, "force"),
 		OPT_BOOLEAN('m', NULL, &opts.merge, "merge"),
-- 
1.5.5
Next: Junio C Hamano
Message 1 of 6 in “git checkout: add -t alias for --track”
  1. git checkout: add -t alias for --trackMiklos Vajna, Apr 23, 2008
  2. Junio C HamanoApr 27, 2008
  3. Junio C HamanoApr 27, 2008
  4. Miklos VajnaApr 27, 2008
  5. Johannes SchindelinApr 27, 2008
  6. Junio C HamanoApr 27, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.