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

Possible to update-ref remote repository?

From
JHJesse Hopkins <jesse.hops@gmail.com>
Date
Sep 30, 2023, 16:34 UTC
Message-ID
<CAL3By--HowOL1ffKBPfmwnfUdJd4KXcnkpS2BgkbO=9E2WnHKw@mail.gmail.com>
Hello -

Wondering if it's possible to do the equivalent of the update-ref command remotely. Or I guess another way of putting it would be to git-push to a remote repository without needing a local clone of the repo.

Trying do something like:
git push <remote-repo-url>  <sha1>:refs/heads/mybranchtoupdate

where I know that <sha1> already exists on the remote. I'd like to avoid the need to clone a local copy of the repo. Wondering if there might be some plumbing command(s) that could accomplish this?

Regards, Jesse

P.S. I think think a minimal way to do this using git push would be:

git init git remote add origin <remote-repo-url> git fetch origin <sha1>:refs/heads/mybranchtoupdate git push origin refs/heads/mybranchtoupdate:refs/heads/mybranchtoupdate

Seems that if it's known that <sha1> already exists on the remote, the fetch is unnecessary network overhead?

Next: Junio C Hamano
Message 1 of 5 in “Possible to update-ref remote repository?”
  1. Jesse HopkinsSep 30, 2023
  2. Junio C HamanoSep 30, 2023
  3. Jesse HopkinsOct 1, 2023
  4. Jeff KingOct 3, 2023
  5. Junio C HamanoOct 4, 2023

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.