Is there a way to fetch the remote repository of a non-checked-out remote repository with git
?
I have the dotfiles on my remote PC under version control (using yadm
). This repository is cloned on my local PC (also using yadm
). But on my local PC I'm using a different dotfiles management utility (rcm
) which allows for more flexibility.
Since yadm
and rcm
work on a different basis (symlinks to ~
vs. bare git into ~
) I have to jump through hoops to try stuff using yadm
on my local PC:
- unlink my current symlink-dotfiles with
rcm
- checkout the
yadm
-repository
To undo that I then have to
- remove all the files which were cloned when checking out the
yadm
-repository - symlink the files with
rcm
This is annoying. Therefore I cloned the local clone of my yadm
-repository into a different folder. While I'm able to see all the remotes in my local main yadm
-repository, I'm only able to fetch HEAD
in the cloned yadm
-repository.
It looks like that:
remote PC (1): commit a (old, not checked out), commit b (HEAD -> master)
local PC - main repository (2): commit a (HEAD -> master), commit b (origin/master, not checked out)
local PC - other repository (3): commit a (HEAD -> master), commit a origin/master
So on my repository 3
I'm only able to see the commit a
(which is checked out in repository 2
), but not commit b
(which is not checked out in repository 2
, but should be available there). My question is now: how can I get commit b in my repository 3
and why doesn't that work by just git fetch
ing everything?
Update 1: Minor edits to the text were performed to (hopefully) make the issue clearer.