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

Re: Cloning empty repositories, was Re: What is the idea for bare repositories?

From
Bill Lear <rael@zopyra.com>
Date
Nov 14, 2007, 23:38 UTC
Message-ID
<18235.34578.886521.944550@lisa.zopyra.com>
In-Reply-To
<Pine.LNX.4.64.0711142047170.4362@racer.site>
On Wednesday, November 14, 2007 at 20:58:29 (+0000) Johannes Schindelin writes:
Show 15 quoted lines
>...
>I have a better idea:
>
>[the initial import, on another machine:]
>% mkdir new_repo
>% cd new_repo
>% git init
>[add content]
>% git commit -a -m "Initial stuff"
>% git remote add origin git://host/repo
>% git push origin master
>
>If you do not want to be bothered with setting up the default 
>"remote" and "merge" config variables manually, it is reasonable to ask 
>for support to do that in "git remote".

Um, ok, but the above means that this repo now differs from other repos, in that pushing now involves more than 'git push', i.e., 'git push origin master'. Is there not a way to configure it "as if" I had done a 'git clone' and thereafter could just do 'git push'?

I want to do: 1) point to origin; 2) push; and not have to remember "oh yeah, this is that 'special' repo and I have to tack on 'origin master' or it won't work", or to clone it somewhere else and work there.

>If you really think that this workflow has anything to do with cloning an 
>empty repository, I cannot help you.  I mean, you did not need to clone 
>the big, empty void to do the initial commit, or did you?

I just want to point to it and treat it as if it had been cloned to begin with: it is my future "point of origin". If it is not cloning, then it is "pointing to it as my origin", as if it were created by the clone.

What's wrong with 'git init --mirror git://host/repo'? Is it just another special case that's busy work helping only a few, or does it belong elsewhere in your opinion?

>(I actually think that it is another example of cvs/svn damage, where you 
>_need_ to clone first, or otherwise you will _never_ be able to commit 
>to the repository.)

I think there is a tendency here to blame every shortcoming of git on someone else's supposedly unsanitary past rather than facing up to inherent problems in git itself. We have several very senior, very dedicated software developers who LOVE git, and who loathe CVS, but who nevertheless find many vexing issues in git.

>BTW I am somewhat disgusted by your usage of git:// for pushing.

Whatever. We went through this before on the list and push support was added to git://. We have SUCKY sysadmin support at our company and permissions were getting HOSED using ssh pushes. The git:// protocol makes everything clean on the repo side and no nasty surprises with permissions and no delays begging the support team to clean things up.

Bill
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 44 of 68 in “What is the idea for bare repositories?”
  1. David KastrupNov 12, 2007
  2. Bruno Cesar RibasNov 12, 2007
  3. Johannes SchindelinNov 12, 2007
  4. Jan WielemakerNov 12, 2007
  5. Cloning empty repositories, was Re: What is the idea for bare repositories?Johannes Schindelin, Nov 12, 2007
  6. Matthieu MoyNov 12, 2007
  7. Johannes SchindelinNov 12, 2007
  8. Bill LearNov 12, 2007
  9. Johannes SchindelinNov 12, 2007
  10. Matthieu MoyNov 12, 2007
  11. Johannes SchindelinNov 12, 2007
  12. Matthieu MoyNov 12, 2007
  13. Johannes SchindelinNov 12, 2007
  14. Matthieu MoyNov 12, 2007
  15. Junio C HamanoNov 12, 2007
  16. Nicolas PitreNov 12, 2007
  17. Johannes SchindelinNov 12, 2007
  18. David KastrupNov 13, 2007
  19. Andreas EricssonNov 13, 2007
  20. Matthieu MoyNov 13, 2007
  21. Shawn O. PearceNov 13, 2007
  22. Matthieu MoyNov 13, 2007
  23. Jeff KingNov 13, 2007
  24. Brian GernhardtNov 13, 2007
  25. Matthieu MoyNov 13, 2007
  26. Johannes SchindelinNov 13, 2007
  27. Matthieu MoyNov 14, 2007
  28. Nicolas PitreNov 13, 2007
  29. Jakub NarebskiNov 13, 2007
  30. Johannes SchindelinNov 13, 2007
  31. Junio C HamanoNov 13, 2007
  32. Matthieu MoyNov 13, 2007
  33. Junio C HamanoNov 14, 2007
  34. Matthieu MoyNov 14, 2007
  35. Sergei OrganovNov 14, 2007
  36. Jakub NarebskiNov 14, 2007
  37. Matthieu MoyNov 14, 2007
  38. Sergei OrganovNov 14, 2007
  39. Junio C HamanoNov 14, 2007
  40. Bill LearNov 14, 2007
  41. Bill LearNov 14, 2007
  42. Wincent ColaiutaNov 14, 2007
  43. Johannes SchindelinNov 14, 2007
  44. Bill LearNov 14, 2007
  45. Johannes SchindelinNov 15, 2007
  46. Andreas EricssonNov 15, 2007
  47. David KastrupNov 15, 2007
  48. Andreas EricssonNov 15, 2007
  49. Johannes SchindelinNov 15, 2007
  50. Jeff KingNov 15, 2007
  51. Jeff KingNov 18, 2007
  52. Junio C HamanoNov 18, 2007
  53. Jeff KingNov 18, 2007
  54. Jan WielemakerNov 12, 2007
  55. Bill LearNov 12, 2007
  56. David KastrupNov 12, 2007
  57. Nicolas PitreNov 12, 2007
  58. Johannes SchindelinNov 12, 2007
  59. Nicolas PitreNov 12, 2007
  60. Andreas EricssonNov 12, 2007
  61. Junio C HamanoNov 12, 2007
  62. Jakub NarebskiNov 12, 2007
  63. Jakub NarebskiNov 12, 2007
  64. David TweedNov 12, 2007
  65. David KastrupNov 12, 2007
  66. Jakub NarebskiNov 12, 2007
  67. David KastrupNov 12, 2007
  68. David KastrupNov 15, 2007

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.