logoalt Hacker News

pwdisswordfishytoday at 3:23 PM1 replyview on HN

> You can’t push changes to a non-bare repo – if you try, Git will reject your push.

Sure you can. If the repo has branch foo checked out, but you're changing branch bar, it will happily let you push to bar (or bar->baz). And even if both are working with the same branch, whether or not you get a warning or it's accepted or rejected is controlled by 'receive.denyCurrentBranch'.

> Because nobody can “work” inside a bare repo, it’s always safe to receive pushes from other locations

Mmm... it's "safe" depending on what you're pushing and what's on the other end, which is no different from trying to push to a non-bare repo.


Replies

tonymettoday at 3:47 PM

This is one of gits best features . SSH deploys with offline remote version tracking

show 1 reply