# (unknown)

5 messages from 2007-11-11 to 2007-11-12. Participants: Michael Dressel, Johannes Schindelin, MichaelTiloDressel@t-online.de.
Thread: https://gitlist.dev/t/10805

## Michael Dressel, 2007-11-11 13:08

Subject: (unknown)
Message-ID: <Pine.LNX.4.64.0711111359590.9401@castor.milkiway.cos>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0711111359590.9401%40castor.milkiway.cos

```

>Michael Dressel wrote:
>Ok nice. Another thing is that git-push will push all the tracking 
>branches in refs/remotes/origin. 

I learned that I only have to edit the .git/config file to avoid that 
git-push pushes everything. 

I modified the remotes names and added push lines explicitly.

Is that the recommended way?

In my example (git-branch -a -v):
* exp                 aa854c6 shtest 4
  master              34924b9 mastertest 1
  origin/exp          aa854c6 shtest 4
  origin/master       b68e7a9 brt master 1

I used the following .git/config:
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin1"]
        url = /home/repo/src
        fetch = +refs/heads/master:refs/remotes/origin/master
        push = +refs/heads/master:refs/heads/master
[remote "origin2"]
        url = /home/repo/src
        fetch = +refs/heads/exp:refs/remotes/origin/exp
        push = +refs/heads/exp:refs/heads/exp
[branch "master"]
        remote = origin1
        merge = refs/heads/master
[branch "exp"]
        remote = origin2
        merge = refs/heads/exp

Cheers,
Michael

```

## Johannes Schindelin, 2007-11-11 15:22

Subject: Re: (no subject)
Message-ID: <Pine.LNX.4.64.0711111520260.4362@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0711111520260.4362%40racer.site
In-Reply-To: <Pine.LNX.4.64.0711111359590.9401@castor.milkiway.cos>

```
Hi,

On Sun, 11 Nov 2007, Michael Dressel wrote:

> 
> >Michael Dressel wrote:
> >Ok nice. Another thing is that git-push will push all the tracking 
> >branches in refs/remotes/origin. 
> 
> I learned that I only have to edit the .git/config file to avoid that 
> git-push pushes everything. 

It is documented that you can use "git push origin <branchname>".

> [remote "origin1"]
>         url = /home/repo/src
>         fetch = +refs/heads/master:refs/remotes/origin/master
>         push = +refs/heads/master:refs/heads/master

With "push", it is not necessary to specify the ":<target>".

Also, if "master" is unambiguous, you can write just "master" instead of 
"refs/heads/master".

Furthermore, I suggest not forcing (that's  what "+" does) the push, since 
it is quite possible that you push something old in the wrong direction.  

Hth,
Dscho

```

## MichaelTiloDressel@t-online.de, 2007-11-12 08:00

Subject: Re: cogito remote branch
Message-ID: <1IrUDz-01jF4a0@fwd29.aul.t-online.de>
URL: https://gitlist.dev/e/1IrUDz-01jF4a0%40fwd29.aul.t-online.de
In-Reply-To: <Pine.LNX.4.64.0711111520260.4362@racer.site>

```

(I forgot to put the subject previously)

> Johannes Schindelin wrote:
>Hi,

>On Sun, 11 Nov 2007, Michael Dressel wrote:

>> 
>> >Michael Dressel wrote:
>> >Ok nice. Another thing is that git-push will push all the tracking 
>> >branches in refs/remotes/origin. 
>> 
>> I learned that I only have to edit the .git/config file to avoid that

>> git-push pushes everything. 

>It is documented that you can use "git push origin ".

>> [remote "origin1"]
>>         url = /home/repo/src
>>         fetch = +refs/heads/master:refs/remotes/origin/master
>>         push = +refs/heads/master:refs/heads/master

>With "push", it is not necessary to specify the ":".
So just a line like
             push = master

A push is needed somewhere in order to prevent every remote to be pushed
by default,
right?

>Also, if "master" is unambiguous, you can write just "master" instead
of 
>"refs/heads/master".

>Furthermore, I suggest not forcing (that's  what "+" does) the push,
since 
>it is quite possible that you push something old in the wrong
direction.  

O.k. I will reconsider this.

Cheers,
Michael

```

## Johannes Schindelin, 2007-11-12 09:55

Subject: Re: cogito remote branch
Message-ID: <Pine.LNX.4.64.0711120954460.4362@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0711120954460.4362%40racer.site
In-Reply-To: <1IrUDz-01jF4a0@fwd29.aul.t-online.de>

```
Hi,

On Mon, 12 Nov 2007, MichaelTiloDressel@t-online.de wrote:

> So just a line like
>              push = master

Exactly.

> A push is needed somewhere in order to prevent every remote to be pushed 
> by default, right?

You mean a "push" config variable?  No.  I think I mentioned in my first 
reply that

	git push <remote> <branch>...

works quite wonderfully.

Hth,
Dscho

```

## MichaelTiloDressel@t-online.de, 2007-11-12 10:47

Subject: Re: cogito remote branch
Message-ID: <1IrWpc-0kFExM0@fwd28.aul.t-online.de>
URL: https://gitlist.dev/e/1IrWpc-0kFExM0%40fwd28.aul.t-online.de
In-Reply-To: <Pine.LNX.4.64.0711120954460.4362@racer.site>

```

Johannes Schindelin wrote:

>> A push is needed somewhere in order to prevent every remote to be
pushed 
>> by default, right?

>You mean a "push" config variable?  No.  I think I mentioned in my
first 
>reply that

>	git push  <remote> <branch>...

>works quite wonderfully.

I mean a push = .. line in the [remote <name>] block.
And if there is such a line than git-push without arguments will push
only
the current branch. For me that is nice, because if I forgot to give 
an argument to git-push it will not push other branches.

If there is no such line all the remotes (that don't have a push line?) 
get pushed. 

Cheers,
Michael

```
