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

Re: git push to a non-bare repository

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Mar 19, 2007, 09:19 UTC
Message-ID
<vpq8xdtpp3g.fsf@olympe.imag.fr>
In-Reply-To
<20070319020053.GA11371@thunk.org>
Theodore Tso <tytso@mit.edu> writes:
Show 13 quoted lines
> On Sun, Mar 18, 2007 at 06:31:21PM +0100, Matthieu Moy wrote:
>> I have a repository with a working tree on a machine A, did a clone to
>> another machine B and commited there locally.
>> 
>> I want my changes to get back into the first repository, so I did a
>> "push". The new commit is in the history, I can see it with "git log",
>> but the modifications are not in the working tree.
>
> The general answer (which you've already received) is to tell folks is
> to simply don't use "git push" to remote trees; basically, if you ever
> have a non-bare repository, it doesn't do what you expect, and it will
> leave the novice user horribly confused.  A much better answer is to
> simply go back to machine A, and pull from machine B.

It's not really an option in my case. A is a fixe-IP/fixe-DNS machine, while B is my home machine, behind a NAT modem-router. So, I'd have to figure out my home IP, port-forward the ssh port from the modem to my machine, ...

If I understand correctly the other answers, I have two options:
* Git doesn't manage this case, and doesn't care about me loosing data
  if they're not commited, I'll have to do it myself with hooks.
* Create a bare repository on machine A, and clone it to a non-bare
  repo on which I'll work. But that means duplicating the repository
  on the same filesystem of the same machine. Not really satisfactory
  either. The "light checkout" feature would make it better, but I'm
  still worried about what will happen to my light checkout when
  someone pushes to the repository.
-- 
Matthieu
Previous: Junio C HamanoNext: Jakub Narebski
Message 24 of 27 in “git push to a non-bare repository”
  1. Matthieu MoyMar 18, 2007
  2. Junio C HamanoMar 18, 2007
  3. Sam VilainMar 18, 2007
  4. Jakub NarebskiMar 18, 2007
  5. Junio C HamanoMar 18, 2007
  6. Theodore TsoMar 19, 2007
  7. Junio C HamanoMar 19, 2007
  8. Shawn O. PearceMar 19, 2007
  9. Theodore TsoMar 19, 2007
  10. Shawn O. PearceMar 19, 2007
  11. Theodore TsoMar 19, 2007
  12. Shawn O. PearceMar 19, 2007
  13. Nicolas PitreMar 19, 2007
  14. Theodore TsoMar 19, 2007
  15. Junio C HamanoMar 19, 2007
  16. Nicolas PitreMar 19, 2007
  17. Nicolas PitreMar 19, 2007
  18. Sam VilainMar 19, 2007
  19. Junio C HamanoMar 20, 2007
  20. Junio C HamanoMar 20, 2007
  21. Theodore TsoMar 19, 2007
  22. Shawn O. PearceMar 19, 2007
  23. Junio C HamanoMar 19, 2007
  24. Matthieu MoyMar 19, 2007
  25. Jakub NarebskiMar 19, 2007
  26. Neil SchemenauerMar 21, 2007
  27. Sergio CallegariMar 19, 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.