Re: Adding push configuration to .git/config
- From
- MichaelTiloDressel@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_BranchCheers, Michael