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

Re: Adding push configuration to .git/config

From
MMichaelTiloDressel@t-online.de <michaeltilodressel@t-online.de>
Date
Nov 23, 2007, 13:07 UTC
Message-ID
<1IvYFV-0vJb1s0@fwd35.aul.t-online.de>
On Nov 22, 2007, at 12:23 PM, Johannes Schindelin wrote:
>You know that I believe the current default is not such a
>choice.

To me the default is not very clear. I read somewhere (I wish I could find where that was again) that push will e.g. push all the remotes that do not contain a push line by default (or maybe only in case the remote belonging to the current branch does not contain a push?).

Anyway the way I try at the moment to have push by default only push the current branch is by setting up a separate remote for each branch even if they belong to the same remote subdirectory. In addition I have a remote named origin which contains a line: push = nothing:nowhere which creates an error for the default case that has no explicit remote.

My .git/config looks something like this:
[remote "origin"
        url = git+ssh://myuid@server/gitrepos/myprogit
        fetch = +refs/heads/master:refs/remotes/origin/master
        fetch =
+refs/heads/TopicA_v0.14_Branch:refs/remotes/origin/TopicA_v0.14_Branch
        fetch =
+refs/heads/mypro-v0.31_Branch:refs/remotes/origin/mypro-v0.31_Branch
        push = nothing:nowhere
[remote "master"]
        url = git+ssh://myuid@server/gitrepos/myprogit
        fetch = +refs/heads/master:refs/remotes/origin/master
        push = refs/heads/master:refs/heads/master
[remote "topicA"]
        url = git+ssh://myuid@server/gitrepos/myprogit
        fetch =
+refs/heads/TopicA_v0.14_Branch:refs/remotes/origin/TopicA_v0.14_Branch
        push =
refs/heads/TopicA_v0.14_Branch:refs/heads/TopicA_v0.14_Branch
[remote "mypro-v0.31"]
        url = git+ssh://myuid@server/gitrepos/myprogit
        fetch =
+refs/heads/mypro-v0.31_Branch:refs/remotes/origin/mypro-v0.31_Branch
        push =
refs/heads/mypro-v0.31_Branch:refs/heads/mypro-v0.31_Branch
[branch "master"]
        remote = master
        merge = refs/heads/master
[branch "mypro-v0.31_Branch"]
        remote = mypro-v0.31
        merge = refs/heads/mypro-v0.31_Branch
[branch "TopicA_v0.14_Branch"]
        remote = topicA
        merge = refs/heads/TopicA_v0.14_Branch

Cheers, Michael

Message 1 of 1 in “Re: Adding push configuration to .git/config”
  1. MichaelTiloDressel@t-online.deNov 23, 2007

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.