Re: "proper" way to deactivate push for a remote?
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- Apr 16, 2018, 18:24 UTC
- Message-ID
- <CA+P7+xow0HSMJJn8DFgqhnU1ZLdrLPZy8Wv0tTLAE3ufQmpD_g@mail.gmail.com>
- In-Reply-To
- <alpine.LFD.2.21.1804160659300.6118@localhost.localdomain>
On Mon, Apr 16, 2018 at 7:03 AM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
Show 18 quoted lines
> > another feature i've seen for the very first time ... working with > kubernetes so i checked it out of github, and part of the instructions > for that is to make sure you don't accidentally try to push back to > the github remote, so the directions suggest: > > $ git remote add upstream https://github.com/kubernetes/kubernetes.git > $ git remote set-url --push upstream no_push > > fair enough, i just assumed the word "no_push" was some magical > keyword in that context, but as i read it, all you need to do is put > *some* invalid URL value there, is that correct? > > and is that the accepted way to do that? what about just deleting > that line from .git/config? is that valid, or is there a different > recommendation for doing that? thanks. > > rday
I've done this in the past by using a push hook which just reports an error. That's how I'd do it.
I think if you also set the push url to the empty string it would also work.
Thanks, Jake