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

[PATCH 3/7] git-clone - Set remotes.origin config variable

From
Mark Levedahl <mlevedahl@gmail.com>
Date
Feb 3, 2008, 17:31 UTC
Message-ID
<1202059867-1184-4-git-send-email-mlevedahl@gmail.com>
In-Reply-To
<1202059867-1184-3-git-send-email-mlevedahl@gmail.com>

This records the users choice of default remote name (by default "origin") as given by the -o option.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
---
 Documentation/git-clone.txt |    3 ++-
 git-clone.sh                |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 2341881..f15aecd 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -103,7 +103,8 @@ OPTIONS
 --origin <name>::
 -o <name>::
 	Instead of using the remote name 'origin' to keep track
-	of the upstream repository, use <name> instead.
+	of the upstream repository, use <name> instead. The name
+	is recorded in the core.origin config variable.
 
 --upload-pack <upload-pack>::
 -u <upload-pack>::
diff --git a/git-clone.sh b/git-clone.sh
index b4e858c..7208d68 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -242,6 +242,7 @@ fi &&
 export GIT_DIR &&
 GIT_CONFIG="$GIT_DIR/config" git-init $quiet ${template+"$template"} || usage
 
+git config core.origin $origin
 if test -n "$bare"
 then
 	GIT_CONFIG="$GIT_DIR/config" git config core.bare true
-- 
1.5.4.18.g43c18
Previous: Mark LevedahlNext: Mark Levedahl
Message 4 of 19 in “[resend] - Improve handling remotes, origin, submodules”
  1. [resend] - Improve handling remotes, origin, submodulesMark Levedahl, Feb 3, 2008
  2. 1/7 Teach remote machinery about core.origin config variableMark Levedahl, Feb 3, 2008
  3. 2/7 git-remote - Unset core.origin when deleting the default remoteMark Levedahl, Feb 3, 2008
  4. 3/7 git-clone - Set remotes.origin config variableMark Levedahl, Feb 3, 2008
  5. 4/7 git-submodule - Possibly inherit parent's default remote on init/cloneMark Levedahl, Feb 3, 2008
  6. 5/7 Teach git-submodule to use top-level remote when updating subprojectsMark Levedahl, Feb 3, 2008
  7. 6/7 git-submodule - Allow adding a submodule in-placeMark Levedahl, Feb 3, 2008
  8. 7/7 Add t/t7401 - test submodule interaction with remotes machineryMark Levedahl, Feb 3, 2008
  9. Johannes SchindelinFeb 3, 2008
  10. Mark LevedahlFeb 4, 2008
  11. Johannes SchindelinFeb 4, 2008
  12. Mark LevedahlFeb 4, 2008
  13. Johannes SchindelinFeb 4, 2008
  14. Junio C HamanoFeb 4, 2008
  15. Johannes SchindelinFeb 4, 2008
  16. Junio C HamanoFeb 4, 2008
  17. Johannes SchindelinFeb 4, 2008
  18. Steffen ProhaskaFeb 4, 2008
  19. Johannes SchindelinFeb 4, 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.