git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Setting of push.default or confusion about refspecs
@ 2013-06-03 22:01 Kendall Shaw
  2013-06-03 23:21 ` Kendall Shaw
  0 siblings, 1 reply; 2+ messages in thread
From: Kendall Shaw @ 2013-06-03 22:01 UTC (permalink / raw)
  To: Git List

I am setting up a git repository which I cloned using git svn. git 
ls-remote shows something like:

...
refs/remotes/trunk
refs/remotes/2.0.2a
...

To get the subversion branch names to appear as a local branch, I:

git remote add blah http://example.com/blah
git fetch blah +refs/remotes/*:refs/heads/*

I have made changes now that are okay to be in master in my local 
repository and I want to push them to the remote repository. The current 
branch is master.

git push

complains that push.default is not set. Now, I am confused by the 
documentation.

push.default settings refer to either "the upstream branch" or a branch 
with "the same name".

What is "the same name"? Are these the same name:

master
refs/remotes/origin/master

also, after the fetch above, are these the same name:

refs/heads/something
refs/remotes/something

Regarding the upstream branch, I have in .git/config

[remote "origin"]
url = http://example.com/blah
fetch = +refs/heads/*:refs/remotes/origin/*

[branch "master"]
remote = origin
merge = refs/heads/master

git config -l shows

branch.master.remote=origin
branch.master.merge=refs/heads/master

When in branch master, is the upstream branch refs/heads/master?

Then, I think I can get push to push to refs/remotes/origin/master by 
setting push.default to upstream, is that right?

In case "master" is not the same name as "refs/remotes/origin/master", 
can you give me an example of branches with the same name that push 
would push to when push.default is set to simple?

Kendall

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Setting of push.default or confusion about refspecs
  2013-06-03 22:01 Setting of push.default or confusion about refspecs Kendall Shaw
@ 2013-06-03 23:21 ` Kendall Shaw
  0 siblings, 0 replies; 2+ messages in thread
From: Kendall Shaw @ 2013-06-03 23:21 UTC (permalink / raw)
  To: Git List

On 06/03/2013 03:01 PM, Kendall Shaw wrote:
> ... Regarding the upstream branch, I have in .git/config
>
> [remote "origin"]
> url = http://example.com/blah
> fetch = +refs/heads/*:refs/remotes/origin/*
>
> [branch "master"]
> remote = origin
> merge = refs/heads/master
>
> git config -l shows
>
> branch.master.remote=origin
> branch.master.merge=refs/heads/master
>
> When in branch master, is the upstream branch refs/heads/master?
>
> Then, I think I can get push to push to refs/remotes/origin/master by 
> setting push.default to upstream, is that right?

I bit the wax tadpole and tried it. I think setting push.default set to 
upstream does what I thought.

Kendall

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-03 23:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-03 22:01 Setting of push.default or confusion about refspecs Kendall Shaw
2013-06-03 23:21 ` Kendall Shaw

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).