![]() ![]() ![]() Team members will receive the updated repository structure on git pull, If you’ve moved the submodule into a location other than its original - make sure to delete the old, now untracked submodule directory.Git's distributed nature encourages users to create new branches often and to merge them regularly as a part of the development process - and certain Git workflows exploit this extensively. Git push origin master Other team members Success! Our git history now looks like this: * 1a2f1aa - (HEAD -> master) Merge remote-tracking branch 'models-origin/master' |\ | * cb445ce - Move all files into models directory | * a11655d - Fix horrible bug | * ed201c4 - Add comments model | * 3d7f342 - Add posts model | * c723ee7 - Initial commit * 346be76 - Remove models sumbmodule * 2144b65 - Update models reference * 0d1671a - Fix horrible bug * 52c4b1a - Update models submodule * 773024f - Add posts feature * 7e01883 - Add models submodle * 10c61f0 - Initial commit git merge -allow-unrelated-histories models-origin/master.git remote add models-origin git fetch models-origin.The final step is to merge the models repository into the main repository. Merging the submoduleĪll the pieces are in place. The models directory is now untracked, we can delete it. Git commit -m 'Remove models submodule' 1.6 Delete the submodule directory: git/modules/models 1.5 Commit the changes 1.3 Remove the submodule from git tracking git/config has a similar entry, edit that file as well. gitmodules file: path = models url = remove the submodule from that file. Git submodules metadata is stored in the. The submodule is referenced in several locations, so removing it cleanly requires several steps: 1.1 Edit. Next we need to remove the submodule from the main repository. git commit -m 'Move all files into src/models directory'.git ls-tree master -name-only | xargs -I src/models.src/models directory and move all the tracked files in there. Our end goal requires the files to be under. Why? Lets look at the file structure in the models repository: ├── index.js ├── comments.js └── posts.js ![]()
0 Comments
Leave a Reply. |