git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Possible to update-ref remote repository?
@ 2023-09-30 16:34 Jesse Hopkins
  2023-09-30 17:17 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Jesse Hopkins @ 2023-09-30 16:34 UTC (permalink / raw)
  To: git

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?

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

end of thread, other threads:[~2023-10-04  1:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-30 16:34 Possible to update-ref remote repository? Jesse Hopkins
2023-09-30 17:17 ` Junio C Hamano
2023-10-01 22:03   ` Jesse Hopkins
2023-10-03 20:00     ` Jeff King
2023-10-04  1:13       ` Junio C Hamano

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).