I made sure that my project was using the hdb branch by doing git submodule --remote meta-dataset
. But git submodule
does NOT agree with the git branch
command when I cd into the repo:
(meta_learning) brandomiranda~/ultimate-utils/tutorials_for_myself/my_git ❯ git submodule update --init --recursive --remote meta-dataset
(meta_learning) brandomiranda~/ultimate-utils/tutorials_for_myself/my_git ❯ git submodule status
ca81edbf5093ec5ea1a1f5a4b31ec4078825f44b meta-dataset (arxiv_v1-200-gca81edb)
then I check the branch by cding into the submodule:
(meta_learning) brandomiranda~/ultimate-utils/tutorials_for_myself/my_git ❯ cd meta-dataset
(meta_learning) brandomiranda~/ultimate-utils/tutorials_for_myself/my_git/meta-dataset ❯ git branch
* hdb
why are they not agreeing?
Version of git:
git version 2.37.0 (Apple Git-136)
The command git log --decorate --oneline --graph --all --branches
shows:
* ca81edb (HEAD -> master, origin/master, origin/HEAD) Merge pull request #86 from peymanbateni/main
|\
| * e3f90db Readme typo fixed.
| * 3cfb2b3 Semantic updates to table link entries.
| * 9ed89a1 Updated readme and leaderboard notebook.
| * 81794ed Merge branch 'main' of https://github.com/peymanbateni/meta-dataset
| |\
| | * c5542c9 Merge branch 'google-research:main' into main
| | |\
| |_|/
|/| |
* | | 8fbfc63 Fix requirements typo
* | | d868ea1 Resolves #85
* | | 1e81d11 Internal change
| * | 1705427 Leaderboard script updated to handle multiple references for the same method.
| |/
| * f725ab7 Update README.md
| * 717caf7 Update README.md
| * 1a3d45b Update README.md
| * 1542931 Update README.md
| * 81ae589 Update README.md
|/
* 7cb980c Add new TSA and Simple/Transductive CNAPs results to the leaderboard.
* e12d61d Remove sources which have no training split from training instructions
:
Weird it's missing it?
(meta_learning) brandomiranda~/diversity-for-predictive-success-of-meta-learning/meta-dataset ❯ git branch --all
* master
remotes/origin/HEAD -> origin/master
remotes/origin/arxiv_v2_dev
remotes/origin/master
despite me JUST adding it again from scratch...
tried doing:
# - https://mcmap.net/q/13651/-how-do-i-quot-git-clone-quot-a-repo-including-its-submodules/3796947#3796947
# - git submodule init initializes your local configuration file to track the submodules your repository uses, it just sets up the configuration so that you can use the git submodule update command to clone and update the submodules.
git submodule init
# - The --remote option tells Git to update the submodule to the commit specified in the upstream repository, rather than the commit specified in the main repository.
git submodule update --init --recursive --remote
again
output:
(meta_learning) brandomiranda~/diversity-for-predictive-success-of-meta-learning ❯ git submodule init
# - The --remote option tells Git to update the submodule to the commit specified in the upstream repository, rather than the commit specified in the main repository.
git submodule update --init --recursive --remote
zsh: command not found: #
From github.com:brando90/meta-dataset
* [new branch] hdb -> origin/hdb
(meta_learning) brandomiranda~/diversity-for-predictive-success-of-meta-learning ❯
(meta_learning) brandomiranda~/diversity-for-predictive-success-of-meta-learning ❯ git submodule status
ca81edbf5093ec5ea1a1f5a4b31ec4078825f44b meta-dataset (arxiv_v1-200-gca81edb)
6e60161962ae3fa309335da7aa1c675c75ecca54 pytorch-meta-dataset (heads/hdb)
seems it there but git subomdule status doesn't show it.
Doesn't work even if I try to target the specific git submodule:
(meta_learning) brandomiranda~/diversity-for-predictive-success-of-meta-learning ❯ git submodule update --init --recursive --remote meta-dataset
(meta_learning) brandomiranda~/diversity-for-predictive-success-of-meta-learning ❯ git submodule status
ca81edbf5093ec5ea1a1f5a4b31ec4078825f44b meta-dataset (arxiv_v1-200-gca81edb)
6e60161962ae3fa309335da7aa1c675c75ecca54 pytorch-meta-dataset (heads/hdb)
It's there now:
(meta_learning) brandomiranda~/diversity-for-predictive-success-of-meta-learning/meta-dataset ❯ git branch --all
* master
remotes/origin/HEAD -> origin/master
remotes/origin/arxiv_v2_dev
remotes/origin/hdb
remotes/origin/master
in the submodule but it's still on the wrong branch even if I try git submodule update --romte it even with the name to it.
Ok the the git subomdule cmd def doesn't think the project is on the hdb branch. I moved their, checkout it out explicitly. It's def in it but the submodule command refuses to agree -- even when I try to re update it multiple times and re add it and git fetch it with --remote.
(meta_learning) brandomiranda~/diversity-for-predictive-success-of-meta-learning ❯ cd meta-dataset
(meta_learning) brandomiranda~/diversity-for-predictive-success-of-meta-learning/meta-dataset ❯ git checkout hdb
branch 'hdb' set up to track 'origin/hdb'.
Switched to a new branch 'hdb'
(meta_learning) brandomiranda~/diversity-for-predictive-success-of-meta-learning/meta-dataset ❯ git branch
* hdb
master
(meta_learning) brandomiranda~/diversity-for-predictive-success-of-meta-learning/meta-dataset ❯ cd ..
(meta_learning) brandomiranda~/diversity-for-predictive-success-of-meta-learning ❯ git submodule status
ca81edbf5093ec5ea1a1f5a4b31ec4078825f44b meta-dataset (arxiv_v1-200-gca81edb)
6e60161962ae3fa309335da7aa1c675c75ecca54 pytorch-meta-dataset (heads/hdb)
Ref:
- related: Why do I need to add the `--remote` to git's submodule when I specify the branch in the .gitmodule file?
- cross: https://www.reddit.com/r/git/comments/102n08e/why_does_git_submodule_status_not_match_the/ -- cross: https://www.quora.com/unanswered/Why-does-the-git-submodule-status-not-match-the-output-of-the-git-branch-of-my-submodule
git version 2.37.0 (Apple Git-136)
– Masciagit log --decorate --oneline --graph --all --branches
in the submodule folder, do you see both branchesmeta-dataset
andhdb
? Or are there referencing the same commit? – Isotone