3 ms·
> 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
by pwdisswordfishy 8mo ago
> 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.
- tonymet 8mo agoThis is one of gits best features . SSH deploys with offline remote version tracking
- fragmede 8mo agoGitHub having a connection of ssh public keys is another feature that's really neat. You can give someone access to your server without having to give them a password somehow.
- tonymet 8mo agoExactly. And it’s great to move code around without having to add keys to GitHub/gitlab. Wherever you have ssh access you can push refs , build and deploy. Great for embedded systems where you may have dozens and you don’t want to add keys to GitHub for each one.
- embedding-shape 8mo agoAnother nice little "hidden" thing is that you can get people's public keys from just a GitHub username, and be kind of sure it is keys in active use, by doing http://github.com/$username.keys http://github.com/$username.keys. Adding access to a new user? `curl https://github.com/embedding-shapes.keys https://github.com/embedding-shapes.keys >> /home/user/.ssh/authorized_keys`