Advanced iOS : Git Submodule in iOS (A Parallel Software Development Approach)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so i have one topic today which is get sub module how you can just do your parallel development in your organization or in your team you can use the get sub module it will be the best approach right so i want to tell you like how it will proceed it's a simple panel development approach how it's different from cocoa pods swift package implementation right so suppose you have a reusable framework team a framework is there which is consumed a comp component is there which is consumed by your n number of applications which is developing in your team they're like you divided f1 team two team three team four team and five team those teams are working parallelly but what about the reusable framework team and how like they will get update all applications are dependent on this component and that component quickly it can just update over there in all apps simultaneously right so you can do a get sub module and you can make this framework as a part of these repositories right so suppose i'm working on app one i want this framework update every time then i will make it as it gets repository and i don't need to ask again and again so like five people five application team will not bother to this framework and your smooth development will proceed over there framework will development team will work and just it will uh push and pull all the code over there on the particular repository and those application members like f1 to f5 those will silently get update with this get sub module so how it will initiate also i want to tell you like swift package and cocoa ports those are different from this git support sub moduling like app one have a a different repository and the git support you'll have a different repository right but it is added into your application itself into your main repository right as a child repository so that is the different and whenever you want you can detect this repository as well but into the application like into the swift package and cocoa port like it will it will never ever be like separate repository it will add into the project itself right so in these swift package and coca ports it will be the part of your source code right now how you can modify add and remove this reusable component git submodule in your apps with the git repository so quickly we'll see another git submodule command there are some eight points i created first you need to create a app on a bit bucket and then clone it in your local system second like you need to create a framework team framework and just clone it into your local system then you can add that reusable component into your app one as an example right so then you can just update it you you can update the framework and get the update in your application how how you will do this also once you will do the fresh clone after the adding sub module how it will work and how it will look like and finally how you can just remove this uh framework from that child repository from your main application right so quickly we'll go there and check it out how we can just use them so i'll go to the git repository i'll create a project for my application first so i'll do like app one project name and once i'll create this this will create a project and then i want an application which will be application one and i'll add this application here same like that i'll create another repos project that project will be my framework team project and i'll create that framework team project also i'll create a repository over there framework team project and inside that if i will add one repository that name will be a reusable framework will be there right and then like uh you'll see those two uh examples are created over there one is framework team and another is the app team right so if i will uh make open them in a different different places then you will see these will look like that now you can just go to your desktop and just create two folders one is a framework key and another is your app team right so you can assume like this uh into this right now we are working on a same system but yeah those can be in the different different teams and now i want to clone them so i will do command t so two command prompts will open two tabs will open so in one tab i'll make it as a app team uh path and another will be my framework team path right so in this framework team path you will work for the framework in this you will work for the app team right so now what you need to do you can just clone this thing into your application uh project you can clone there on this repository the app one and same like that you can just clone your reusable framework on your local machine like that right so i need to check whether i'm there or not so i think i just did not made the space in between uh cd and user so i'll do this and then i'm on framework and then i can just clone this right so once i'll clone clone will complete over there now my duty is there like i can just create two projects and those projects will be one will be my application like app one and that will be in my desktop and it will be into my application right and another i'll create one more project and which will be the part of my framework right and in this framework i'll create as a framework and this will be my reusable framework right now i need to add this into my desktop framework inside the framework team and framework repository itself so once i'll add this i'll create one more example here so that while updating the sub module you will see the difference so test is there this test class is loaded with one more feature public class test and i can just create a public class function itself inside this and that function will be a feature one function right so it will print some feature one kind of thing right and now i can just run this and i can just take a product of it and i can use this project product into my app team like here i can just paste it and i can open the app and i can just drag this framework here right so now i successfully done everything and i can just push whole things whatever i just added so i'll see like first i'll do ls i need to go one more step inside this so i'll go by cd reusable and then i'll do this git status project is added framework is added so i'll push them into the bit bucket and i'll do this like that get commit and then you can just push sorry for my dog uh yeah get commit m and then like project loaded and get push right now same like that if i will go to the app team i'll see clear everything get state uh i'll go ls and then we'll see like there is a cd application is there then i'll see get status and the app project is loaded and also framework is updated right so again and get comment and then add plus framework loaded right okay now things are perfectly fine if you will see get status here it will be on your branch right so that's perfectly fine and here also you will see everything is clear and get status will be look like that now two steps are completed finally you need to go there those two steps are completed cloned created clone created framework now add your framework as a sub module in your application right so how you can just do this you can just create a get sub module add with the url what url the your project url right so this will be the url right so now you can just go and just copy the url first this one you will copy okay and then you can just do here in your application one folder you can go there and just check how you can just clone this how you can just add this git add sub module right and then you can just do like this so get some module add i think it will be like i need to clear get sub module and add will be there and add this one right so it will add over there and it will clone also right and one more dot get modules file is created if you will open this you will see one reusable sub module is added the path is reusable framework which is here only right and inside that one framework is also added and it's a uh like uh framework which we added right now if suppose feature two came framework uh team is working over there and he just what the framework guy he done like feature two also right and it will be a feature too how it will update and show in my you know uh the git repository and i want to add this on my bit bucket as well so it's a framework and then if i will do uh clear and check get status feature 2 is added into my test to swift file so get add get commit and feature to add it right now git push i'll do it will load over there on my repository as a commit if you will see feature to add it now how i will do i will check like whether this feature came into my app team so i'll give a green flag like i don't need to ask to any person i'll go there and feature one is already updated and i'm if i will update like i will import import here my r framework and i'll check like i have a test application which have feature one only if i want feature two now how i can just get this information right because i have a reusable framework in hand right now i don't need to ask to anybody i'll go there and in this if you will see uh git is inside this as well so it's a child repository right and some module we added this multiple components also you can add right so now what you need to do you can just do cd and you can go till this uh gets a module path and then you can see like get status if something changed then you can update that no nothing is changed now you can do git pull and it will pull your you know whatever you changed right the test you changed with the feature too so the framework guy changed something and it came here and the feature 2 is also reflecting here as well right so like that you can just do this thing now if it's a completely updated project you will just build this you will get the output and that output you can just copy and just replace over there at your project inside this right so if you will go to the app one you can just replace here the reusable framework will replace with the next newer one and you will go and test feature two will come here as well that's all right so you can update these things like that as well now get status will be there and if you will see those get status they're like in inside your inside your application if you will see i want to see in my application itself yeah so clear inside now again i don't forget to change the path of this application because i am in sub module right now so get clear cd and i'll do my gets my main application path again and then if i will see its status i change a an app delegate right so what i need to do also i added git submodule and reusable framework also so i'll do these all these things uh add and i will push or commit like i'll add edit a sub module and it is a module uh reusable framework right and plus added f delegate right now if i will clear this and get push this then it will reflect over there at my repository so if i will go and check to my application one it will reflect over there can you see reusable framework is there so this is added perfectly and if you will click on this it's not a part of my app repository right it's a different it will go to the same repository which is already a repository of reusable framework which we created right so like that you can just see in those repository uh get some modules now how you can just get like a fresh once you will go and just do the fresh clone how things will work over there so i'm just deleting this app team here and in this case how you can just clone right because get some more sub module is already added on this repository get a folder with the name name of fresh app clone and this folder you can just add it here and then you can just clone that repository like the project repository what whatever it is then you once you'll clone it will look like that so reusable framework will be there but everything will be empty over there so what you need to do your partner needs to do like that get sub uh get uh like there are commands so you can just to get some module in it first i'm sorry yeah clear and get some model in it yeah it's giving you fatal error why because we are not inside a repository so if you will go and check application one is there so if i will do ls cd application one now i'm on the path of reusable framework if i will hit that command get submodule in it it will say yeah some module is created properly now i want git sub module update and it's cloning right the fresh thing whatever we just created it's cloning so things came here so like a fresh clone for the fresh clone you can just clone like that as well also one another way is like directly you can just clone in one single shot like another direct way git sub module update init recursive right it will update and in it together and also recursive means uh repository inside repository repository inside repository like that right here right now two repositories suppose in the reusable framework also one more repository will be there get some module will be there inside that one more repository as it gets a module will be there then everything will be updated and clone there right with the recursive so that is a good command direct clone with multiple sub module if you want a multiple sub module then you can just use sub modules rather than sub module and you can clone your into your application so that your application will clone with all the sub modules right so you can just directly clone all the things now for getting update for sub module in between i told you already also like for multiple sub module like you can just uh get some information rather than pulling you can just do get some module update in it recursive as well and it will give you the information right for single sub module update you can just do get submodule update in it remote and a path what what will be the path that will be the path if i will tell you here inside this if you will see get get modules this will be the part so lots of frameworks lots of reuse reusable component path will come here and they will and they will be here only so this get dot gets a module uh file is very important and once you will hit uh the uh the update like that if i want then i'll use this one and it will update my uh perfect whatever result will come as a feature too right so like that also rather than pulling and uh pulling from uh going there on the directory and pulling the things uh from there no need of changing the directory here and there directly you can hit this command and you can just up get update from the remote particular component right now the final point is how you can just remove this submodule so d init is there whatever path is there you can use that path so what i will do i'll do the last step get sub module d in it and what what is my path i'll go and check whatever framework you want to remove the component you want to remove from here like if you will see inside this one repository is available my application and inside that sub module is this one i want to remove this right how i will do this so get some d in it my path i'll get this path from this git modules and once i'll hit this it will tell me like following files has local modification okay first if local modification is there then i need to stash that local modification maybe something i changed over there into the framework when i went there and checked this thing so it is saying like local modification is there so what i need to do first i need to go to this path cd and reusable framework path and if i will see git status that will something show like this right so first i want to get stash all the things right now what i need to do check get status so nothing to commit and everything is fine now if i will come to my come to my application folder again cd and it will be a application like that and its status i will see i am updated now if i see like i detest that framework that that's what it was saying so now again what i need to do i can just go and just hit that command get submodule d in it reusable frame so it is saying cleared and my one project is detached from there right and this is it now still the information is available i want to remove this one also so what i will do i'll go and just do this get rm the local path as well right so once i'll do git rm that means it will remove uh my get module information as well so i'll go there and i'll copy this path and get rm remove my framework path now everything is fine okay so once i'll open this it will be empty right so this is all like d initialization as well but still it is not proceed here and if you will refresh it is still there right so i need to push everything whatever i done so that it can detach from there as well get status modified like get some modules and deleted the reusable framework as it gets a module so get add okay commit and removed or detached some module this reusable framework from my app right and git push once i will do this it will complete and from here also it's done now i will refresh it will completely okay and it will silently detach from my code so how beautifully you can just add a git sub module you can update get submodule you can take a fresh clone and you can use those things uh it's fantastic right so the uh update like you will get from the another framework team parallelly also you can just do some work in emergency and also like after the completion of this framework and your application feature by feature they will update and you will get update updated here you don't need to ask them right and you can just update get update and at the end like you can detach this framework and the fruitful result will be there into your app and this will be freely uh a single repository rather than child repository right so hope you enjoyed this i'll put everything into my description box so that you can just get this information nicely and you can work with your team and your organization with a git sub moduling for the reusable components you can inject those reusable components into your repositories right so if you like this thank you so much for watching and just you please share this youtube channel to like needful people thanks a lot thank you
Info
Channel: iOSCoderAbhimanyuDaspan
Views: 743
Rating: undefined out of 5
Keywords: #swiftLang, #ios, #iosCoderAbhimanyuDaspan, #git, #gitsubmodule, #xcode, #iosdev, #apple, #bitbucket, #wwdc
Id: y7w9oz2zcEU
Channel Id: undefined
Length: 25min 32sec (1532 seconds)
Published: Sun Mar 28 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.