Checklist, new feature:
- Go into main repo and verify you are on the
master
branch. Now rungit pull && git submodule update
.
Right now your main repo is up-to-date with the remote and all submodules are in a state the main repo rquires.
NOTE: Submodules are now probably in a detached state (detached HEAD), which is good. The main repo links to a specific commit (sha1 hash)
of the submodule, not an actual branch.
- If you want to make some updates IN the main repo, just create a new branch from master and do your magic!
I want to work on something in CommonSDK
- Create a new branch in CommonSDK and base it of your current HEAD (which is your working copy).
- Code your shit.
- Commit and push normally
NOTE: You need to watch out when working on your branch in CommonSDK, since the HEAD of this repository WILL change if you update
submodules in the main repo. Which can happen if you did some work in the main repo and then wanted to work on your CommonSDK changes again.
IMPORTANT: So always check your branch when you are working again on your CommonSDK changes!
- After you are finished with your CommonSDK changes, you can merge it into CommonSDK master (do this through github for easy merging).
- Now the CommonSDK master contains your new changes.
- To let everyone else taste your new changes in CommonSDK, remember to commit the new CommonSDK sha1 hash in the main repo. This will update the actual submodule.
I want to work on something in main repo which depends on the changes I just made in CommonSDK
Okay, so let's say you didnt merge your feature branch I mentioned earlier and are still working on it.
- In your main repo (Rust) create a new feature branch.
- Go into your submodule directory
cd CommonSDK
and make sure it is on the feature branch you made your changes in. - Make some changes in the main repository and commit + push when you want to save it.
Lets say you are now done with your main repo changes + my submodule changes.
- FIRST make sure all submodules are merged into THEIR master branch. You may NEVER merge into main repo master when the submodules are still on their feature branch.
- Now commit + push the updated submodules again, so your feature branch on the main repo uses the submodules master branch.
- This is the time where you finally merge your feature branch of the main repo into master :D