Typically the source of git fetch
is ref/heads/*
of the remote repository.
Is it not allowed to fetch from remote-tracking branches i.e. ref/remotes/*
of the remote repository?
Of course!
A "normal" fetch is git fetch origin refs/heads/*:refs/remotes/origin/*
This is telling the current repository to connect to origin
, get a list of refs/heads/*
and store the references in the local refs/remotes/origin/
.
You can tweak this to get the origin:refs/remotes/*
like so:
git fetch origin refs/remotes/*:refs/remotes/origin/*
It's worth noting that the usefulness of this depends on your knowledge of the remote you're talking to: You get the remote name that was configured in the remote you're referencing, but you don't get the details about that remote. In other words you could well end up seeing a new entry refs/remotes/origin/origin/master
but what exactly that's tracking would be a mystery unless you know what origin/origin
really is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With