threads / discuss / 29118

configure git to not push all remote tracking branches

Subject: configure git to not push all remote tracking branches

## tl;dr

3 messages between Dec 9, 2011 and Dec 9, 2011.

replies: 2people: 2as markdown or json

Justin Johnson· Dec 9, 2011, 15:00 UTC · lore

Hi, I'm looking for some help with pushing to remote repositories. I accidentally left out the refspec from my git push command and git pushed all branches that are set up to track the remote repo that I specified. I would like to disable this, and enforce specifying a refspec. Is there a way to do this? e.g. git push alternateorigin should not do anything, but git push alternateorigin mybranch should push just mybranch. -- Justin Johnson

Ramkumar Ramachandra· Dec 9, 2011, 15:03 UTC · re: Justin Johnson · lore

Re: configure git to not push all remote tracking branches

Hi Justin,
Justin Johnson wrote:
> git push alternateorigin
> should not do anything, but
> git push alternateorigin mybranch
> should push just mybranch.
$ git config push.default nothing
Note: push.default defaults to "matching"
Cheers.
-- Ram
Justin Johnson· Dec 9, 2011, 15:07 UTC · re: Ramkumar Ramachandra · lore

Re: configure git to not push all remote tracking branches

On Fri, Dec 9, 2011 at 10:03 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:

Show 14 quoted lines
> Hi Justin,
>
> Justin Johnson wrote:
>> git push alternateorigin
>> should not do anything, but
>> git push alternateorigin mybranch
>> should push just mybranch.
>
> $ git config push.default nothing
> Note: push.default defaults to "matching"
>
> Cheers.
>
> -- Ram

Thank you, that's exactly it. I saw it in the docs for git-config but wasn't positive that's what I needed.

--Justin

← back to recent threads