I have an iOS project hosted on Bitbucket which uses MapBox-iOS-sdk which I incorporated as a git submodule. The commit I track is on a develop branch, not the release branch. Say, some times later when I tried to clone anew my project off Bitbucket (via git clone --recursive). And I also like my use of the submodule MapBox-iOS-sdk be updated to the latest from MapBox. So I want to pull. But first it's a "no branch" so I went into the MapBox-iOS-sdk directory of my own project and did a
git checkout -b develop remotes/origin/develop
It gives me output:
M MapView/Map/SMCalloutView Previous HEAD position was 6c6be52... closes #148: incorporate @tmalloy's RMShape bezier curve enhancements
Branch develop set up to track remote branch develop from origin.
Switched to a new branch 'develop'
Then, I did a git pull
and it tells me I'm already up-to-date. At this point, my first question: am I already on the latest commit from the Mapbox develop branch?
At this point, I type git status
in the Mapbox-iOS-sdk directory, I got the following:
git status
# On branch develop
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: MapView/Map/SMCalloutView (new commits)
#
no changes added to commit (use "git add" and/or "git commit -a")
And here is my second question: what does this mean exactly? I'm not trying to modify mapbox-ios-sdk in anyway, all I want to do is to use an official version, but why is it asking me to commit? If I do commit, it appear to me that I would be modifying a new version of Mapbox sdk, and subsequently on my own project I would be tagging to this particular commit, which isn't on the official source. Wouldn't my coworker who tried to pull my project be having problem as the commit cannot be found?
Edit: SMCalloutView is a git submodule that the Mapbox sdk itself incorporated.
Edit 2: All commands were issued when pwd was at the Mapbox-ios-sdk base directory (a sub-directory of my project).
Edit 3: The project is at https://bitbucket.org/t2wu/container-bug
The MapView/Map/SMCalloutView
is a submodule of your MapBox-iOS-sdk
submodule, so you have a nested dependency. And it is that nested dependency that has updated.
If those corrections and updates are important to your project you will need to recursively update the submodules to make sure you have all the updates.
You then need to decide if/how you are working on corrections to those dependencies as part of your superproject, as this will create synchronisation issues.
If you simply use a specific version, and occasionally change to a newer published version than it is no more difficult that the recursive update (which could be easier, see the manual ;-)
If you are also correcting problems you have a really tricky problem of being in two places at once - a) using a published version, and b) using your own corrected version, and trying to join up the two around the back.
Consider making your own fork and repointing the submodule at your fork to allow you to have both variants in the same public repo, and add back an upstream repo. But you then have to maintain your fork with both variants...