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

how to update origin/<branch> after a push to origin <branch>?

From
Llayer <layer@known.net>
Date
May 14, 2009, 04:42 UTC
Message-ID
<19640.1242276135@relay.known.net>
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
Next: Avery Pennarun
Message 1 of 6 in “how to update origin/<branch> after a push to origin <branch>?”
  1. layerMay 14, 2009
  2. Avery PennarunMay 14, 2009
  3. layerMay 14, 2009
  4. layerMay 14, 2009
  5. layerMay 14, 2009
  6. Avery PennarunMay 14, 2009

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.