git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

Previous: Robert P. J. Day
Message 2 of 2 in “"proper" way to deactivate push for a remote?”
  1. Robert P. J. DayApr 16, 2018
  2. Jacob KellerApr 16, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.