I have a small PHP library which I have written to support various web projects. Those projects are all in git, and the library is a submodule of each of those repos. The web projects are deployed with a git push, and the deployment script needs to have access to the library submodule repo to update the library.
Sometimes for any given project the library will have its own branch, until I merge those changes back to the master branch.
I've set up a bare remote repo for that library, and am able to push a library submodule to the remote repo. That works fine, and I can see those commits in the remote repo. However, when I try to deploy, those commits can't be found. In fact, if I clone the remote repo myself, I can't find those commits.
For example, the remote repo looks like this:-
git log --graph --oneline --date-order
* 9c9b880 (BRANCHA)
* e88ee92
* 07260c9
* 40b0963
* 35b6533 (tag: dev/0.0.2, master) Merge branch 'refs/heads/development'
|\
| * ba3c1bd (HEAD, development)
| * eefa611
| * 1b87828 Merge branch 'refs/heads/BRANCHB' into development
| |\
| | * 9078c1c (BRANCHB)
| |/
| * 834e715
| * a000cd7
|/
* 5985fc9 Initial commit
However, if I clone the remote repo as follows:-
git clone -b BRANCHA http://pathto/repo.git
The cloned repo then looks like:-
git log --graph --oneline --date-order
* 07260c9 (HEAD, origin/BRANCHA, BRANCHA)
* 40b0963
* 35b6533 (tag: dev/0.0.2, origin/master) Merge branch 'refs/heads/development
|\
| * ba3c1bd (origin/development, origin/HEAD)
| * eefa611
| * 1b87828 Merge branch 'refs/heads/BRANCHB' into development
| |\
| | * 9078c1c (origin/BRANCHB)
| |/
| * 834e715
| * a000cd7
|/
* 5985fc9
If I do git pull
I am Already up-to-date.
Why when I clone, do I end up on commit 07260c9, not commit 9c9b880, and why doesn't pulling bring down those later commits? Am I missing something about how remote bare repos should work, or should I be pushing to the bare repo in a different way?