Thread (44 messages) flat view 44 messages, 18 authors, 2016-06-15

Re: disallowing push to currently checked-out branch

From: Daniel Barkalow <hidden>
Date: 2016-06-15 22:46:12

On Sun, 15 Feb 2009, david@lang.hm wrote:
If there is some reason for the normal push to try and update the HEAD, index,
and workdir. instead of refusing the push, how about having it put the commits
in the repository and then fail to change the HEAD, index, and workdir if any
of them contain changes? (along with a warning that it's doing so).
A push cannot help but update HEAD, because HEAD is generally literally 
"ref: refs/heads/<current-branch>"; it doesn't store its own value, and 
the storage that it references is the storage that push is updating.

In fact, if you expect to be pushing to a non-bare repository, you 
probably want to have HEAD contain the actual commit currently checked out 
(instead of a reference to externally mutable storage), which you can do 
with "git checkout refs/heads/master".

	-Daniel
*This .sig left intentionally blank*
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help