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

Re: [RFC PATCH 0/4] deny push to current branch of non-bare repo

From
MBMark Burton <markb@ordern.com>
Date
Nov 7, 2008, 22:39 UTC
Message-ID
<loom.20081107T222744-932@post.gmane.org>
In-Reply-To
<20081107220730.GA15942@coredump.intra.peff.net>
Jeff King <peff <at> peff.net> writes:
Show 9 quoted lines
> 
> The short of it is that it's dangerous, we see people confused by it
> (there was another one just yesterday), and it's a FAQ:
> 
>   http://git.or.cz/gitwiki/GitFaq#head-b96f48bc9c925074be9f95c0fce69bcece5f6e73
> 
> The FAQ even says "don't do this until you know what you are doing." So
> the safety valve is configurable, so that those who know what they are
> doing can switch it off.

When I first tried to use git I was bitten by exactly this problem. I know, RTFM, but when everything is new, it's easy to undervalue the words of wisdom when you don't understand the bigger picture and the rational behind the advice.

I now happily work with non-bare repositories on my main machine that I push to from my satellite development machines but, of course, I don't push to the head branches but, instead, to remote branches and then merge on the main machine.

I wouldn't have wasted as much time getting my head around this if git had refused to accept the push to the current branch but, instead, issued a suitable message telling me I probably didn't want to be doing that.

So, from my own experience, I would say this would be a good feature to add.
Cheers,
Mark
Previous: Jeff KingNext: Junio C Hamano
Message 7 of 25 in “deny push to current branch of non-bare repo”
  1. 0/4 deny push to current branch of non-bare repoJeff King, Nov 7, 2008
  2. 1/4 t5400: expect success for denying deletionJeff King, Nov 7, 2008
  3. Jan KrügerNov 9, 2008
  4. 2/4 t5516: refactor oddball testsJeff King, Nov 7, 2008
  5. 3/4 tests: avoid pushing to current branch of non-bare repoJeff King, Nov 7, 2008
  6. 4/4 receive-pack: deny push to current branch of non-bare repoJeff King, Nov 7, 2008
  7. Mark BurtonNov 7, 2008
  8. Junio C HamanoNov 7, 2008
  9. Jeff KingNov 8, 2008
  10. Johannes SchindelinNov 8, 2008
  11. Junio C HamanoNov 8, 2008
  12. Jeff KingNov 9, 2008
  13. Junio C HamanoNov 9, 2008
  14. Kyle MoffettNov 12, 2008
  15. Jeff KingNov 12, 2008
  16. Kyle MoffettNov 13, 2008
  17. Jeff KingNov 13, 2008
  18. Junio C HamanoNov 13, 2008
  19. Kyle MoffettNov 13, 2008
  20. Jeff KingNov 14, 2008
  21. Leo RazoumovDec 2, 2008
  22. Junio C HamanoDec 2, 2008
  23. Leo RazoumovDec 2, 2008
  24. Jeff KingDec 2, 2008
  25. Leo RazoumovDec 2, 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.