Re:Git v2.3 Release Notes
by rspeer on Friday February 06, 2015 @12:48PM
(#9010323)
* "git push" into a repository with a working tree normally refuses
to modify the branch that is checked out. The command learned to
optionally do an equivalent of "git reset --hard" only when there
is no change to the working tree and the index instead, which would
be useful to "deploy" by pushing into a repository.
Nice! This sounds like something that I expected Git to do since the first time I used it, which means that I ran straight into the unfriendly error messages that result from pushing to a checked-out repository.
Using hooks for simple deployments has always seemed clumsy compared to the thing that I originally imagined Git could do. I'm glad to hear that Git now supports this use case.
Re:Git v2.3 Release Notes
by jrochkind1 on Friday February 06, 2015 @02:03PM
(#9010846)
Wait, is this saying that `git push` can now change your local working tree, instead of changing the remote you are pushing to? That doesn't sound like what i'd expect, but I think maybe I'm misunderstanding what it does when?
Using hooks for simple deployments has always seemed clumsy compared to the thing that I originally imagined Git could do. I'm glad to hear that Git now supports this use case.
1) You're pushing to a remote server which has a checkout of the working copy as the live version of something, e.g. a webapp.
2) You're pushing to a co-workers repository to allow them to see updates (though probably a less likely scenario)