* how to update origin/<branch> after a push to origin <branch>?
@ 2009-05-14 4:42 layer
2009-05-14 4:58 ` Avery Pennarun
0 siblings, 1 reply; 6+ messages in thread
From: layer @ 2009-05-14 4:42 UTC (permalink / raw)
To: git
I'm stumped on this one.
I'm in a repo and I push the master branch. If I do
git diff --name-only origin/master..master
after the push, I still see the names of the files I pushed because I
haven't updated origin/master yet, with a fetch. Of course, a "git
pull" would do it, but I don't want to do that, because I might be
using something other than `origin' and I don't want anything but the
single branch.
So, I naively thought that
git fetch origin master
would do the trick, but after that command the git diff above still
shows the same files.
To make matters worse (!!), I made this attempt:
$ git fetch origin master:origin/master
From git:/repo/git/acl
* [new branch] master -> origin/master
$ git diff origin/master..master
warning: refname 'origin/master' is ambiguous.
$
Uh oh.
$ git branch -a | grep origin/master
origin/master
origin/master
$ find .git/refs -type f | grep origin
.git/refs/heads/origin/master
.git/refs/remotes/origin/acl81
.git/refs/remotes/origin/HEAD
.git/refs/remotes/origin/master
$ cat .git/refs/heads/origin/master
28f0f4f2cdf37640b94cdbd65406898222593f28
$ cat .git/refs/remotes/origin/master
4be7cc89d335421a93e4551b40bd06108a030221
$
I'm going to leave my repo as is until a professionals helps me out,
lest I dig the hole deeper.
Thanks.
Kevin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to update origin/<branch> after a push to origin <branch>?
2009-05-14 4:42 how to update origin/<branch> after a push to origin <branch>? layer
@ 2009-05-14 4:58 ` Avery Pennarun
2009-05-14 5:01 ` layer
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Avery Pennarun @ 2009-05-14 4:58 UTC (permalink / raw)
To: layer; +Cc: git
On Thu, May 14, 2009 at 12:42 AM, layer <layer@known.net> wrote:
> after the push, I still see the names of the files I pushed because I
> haven't updated origin/master yet, with a fetch. Of course, a "git
> pull" would do it, but I don't want to do that, because I might be
> using something other than `origin' and I don't want anything but the
> single branch.
>
> So, I naively thought that
>
> git fetch origin master
>
> would do the trick, but after that command the git diff above still
> shows the same files.
Short answer:
git fetch origin
However, 'git push origin master' should update origin/master
automatically, at least in relatively recent git versions. It's
rather weird if that didn't happen.
Have fun,
Avery
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to update origin/<branch> after a push to origin <branch>?
2009-05-14 4:58 ` Avery Pennarun
@ 2009-05-14 5:01 ` layer
2009-05-14 5:13 ` layer
2009-05-14 5:21 ` layer
2 siblings, 0 replies; 6+ messages in thread
From: layer @ 2009-05-14 5:01 UTC (permalink / raw)
To: Avery Pennarun; +Cc: git
Avery Pennarun <apenwarr@gmail.com> wrote:
>> On Thu, May 14, 2009 at 12:42 AM, layer <layer@known.net> wrote:
>> > after the push, I still see the names of the files I pushed because I
>> > haven't updated origin/master yet, with a fetch. Of course, a "git
>> > pull" would do it, but I don't want to do that, because I might be
>> > using something other than `origin' and I don't want anything but the
>> > single branch.
>> >
>> > So, I naively thought that
>> >
>> > git fetch origin master
>> >
>> > would do the trick, but after that command the git diff above still
>> > shows the same files.
>>
>> Short answer:
>>
>> git fetch origin
I'm pretty sure I tried that. I'll certainly verify it once I figure
out how to unwedge my repo.
>> However, 'git push origin master' should update origin/master
>> automatically, at least in relatively recent git versions. It's
>> rather weird if that didn't happen.
That's what I thought. Using git version 1.6.1.3 (client and server
are the same machine).
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to update origin/<branch> after a push to origin <branch>?
2009-05-14 4:58 ` Avery Pennarun
2009-05-14 5:01 ` layer
@ 2009-05-14 5:13 ` layer
2009-05-14 5:21 ` layer
2 siblings, 0 replies; 6+ messages in thread
From: layer @ 2009-05-14 5:13 UTC (permalink / raw)
To: Avery Pennarun; +Cc: git
Avery Pennarun <apenwarr@gmail.com> wrote:
>> On Thu, May 14, 2009 at 12:42 AM, layer <layer@known.net> wrote:
>> > after the push, I still see the names of the files I pushed because I
>> > haven't updated origin/master yet, with a fetch. Of course, a "git
>> > pull" would do it, but I don't want to do that, because I might be
>> > using something other than `origin' and I don't want anything but the
>> > single branch.
>> >
>> > So, I naively thought that
>> >
>> > git fetch origin master
>> >
>> > would do the trick, but after that command the git diff above still
>> > shows the same files.
>>
>> Short answer:
>>
>> git fetch origin
>>
>> However, 'git push origin master' should update origin/master
>> automatically, at least in relatively recent git versions. It's
>> rather weird if that didn't happen.
I decided to attempt cleanup myself:
$ mv .git/refs/heads/origin/ git.refs.heads.origin
$ git diff origin/master..master
diff --git a/ChangeLog b/ChangeLog
index f7b4551..f2200a0 100644
--- a/ChangeLog
+++ b/ChangeLog
...
OK, back to normal.
$ git fetch origin
From git:/repo/git/acl
4be7cc8..28f0f4f master -> origin/master
$ git diff origin/master..master
$
I _swear_ I tried that. <sigh> Sorry to trouble everyone, and thanks
Avery. Appreciated.
Kevin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to update origin/<branch> after a push to origin <branch>?
2009-05-14 4:58 ` Avery Pennarun
2009-05-14 5:01 ` layer
2009-05-14 5:13 ` layer
@ 2009-05-14 5:21 ` layer
2009-05-14 5:29 ` Avery Pennarun
2 siblings, 1 reply; 6+ messages in thread
From: layer @ 2009-05-14 5:21 UTC (permalink / raw)
To: Avery Pennarun; +Cc: git
Avery Pennarun <apenwarr@gmail.com> wrote:
>> Short answer:
>>
>> git fetch origin
I wasn't doing exactly this, but I was doing the equivalent of
git fetch $(git config --get remote.origin.url)
Why would these be different?
Kevin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to update origin/<branch> after a push to origin <branch>?
2009-05-14 5:21 ` layer
@ 2009-05-14 5:29 ` Avery Pennarun
0 siblings, 0 replies; 6+ messages in thread
From: Avery Pennarun @ 2009-05-14 5:29 UTC (permalink / raw)
To: layer; +Cc: git
On Thu, May 14, 2009 at 1:21 AM, layer <layer@known.net> wrote:
> Avery Pennarun <apenwarr@gmail.com> wrote:
>>> Short answer:
>>>
>>> git fetch origin
>
> I wasn't doing exactly this, but I was doing the equivalent of
>
> git fetch $(git config --get remote.origin.url)
>
> Why would these be different?
If you fetch only based on URL, then git doesn't know the name of that
url is 'origin', and thus can't possibly know that it's supposed to
replace origin/master.
BTW, the reason 'git fetch origin master' doesn't work is completely
unrelated: in *that* case, that syntax means you want to fetch the
branch named master, but you're going to do something specific to it,
so it ends up being stored as FETCH_HEAD instead. Generally you don't
want to use that syntax.
Avery
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-05-14 5:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-14 4:42 how to update origin/<branch> after a push to origin <branch>? layer
2009-05-14 4:58 ` Avery Pennarun
2009-05-14 5:01 ` layer
2009-05-14 5:13 ` layer
2009-05-14 5:21 ` layer
2009-05-14 5:29 ` Avery Pennarun
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 NNTP newsgroup(s).