I was looking for an answer regarding the cloning of submodules and you covered it in an incredibly clear way ! Thanks for that, great video!
@RedhwanNacef3 жыл бұрын
You're very welcome, glad it helped! Thank you for the feedback.
@warisulimam34402 жыл бұрын
Simple and precise explanations, incredibly helpful. Thank you so much!
@RedhwanNacef2 жыл бұрын
Thanks! Glad you enjoyed it 😊
@isholaoluwatomisin1906 Жыл бұрын
Detailed explanation to get started with submodules. You could also use the "git submodule update --remote" to update the submodules if the changes were made by another member of your team(Not locally).
@EddieDemon Жыл бұрын
Biggest question mark I was left with, thanks for answering!
@RedhwanNacef Жыл бұрын
Thanks for the additional information.
@hrajabi726112 күн бұрын
Detailed and simple, incredibly helpful. Thanks!
@osys7832 Жыл бұрын
I’m not a git guru but to sum up - git submodule is a fancy name for submodules, they’re essentially just git projects - any commands u can use with your own git project can be used inside the modele projects(git push pull etc) - to recursively install submodules -recursive-submodules is necessary with git pull or clone - same thing goes for the git push as well
@RedhwanNacef Жыл бұрын
You got it! The .gitmodules file is probably a good thing to remember too when summing up.
@JayJay-ki4mi2 жыл бұрын
Redhwan: "This will take a few seconds" Boost: "Go grab a coffee"
@RedhwanNacef2 жыл бұрын
😂
@nikitakrasnytskyi6 ай бұрын
I just want to leave feedback here. I find your way of giving a material to be of very high quality. Compared to many others on learning platforms, you can give material fast and keep the essential pieces. Like, you only cover the most vital submodule commands. Really appreciate the way you teach. Saw this video and subscribed for more.
@thaynethetigerbarnes2 ай бұрын
I think you helped me with a huge problem, I am trying to use strapi for my back-end and I have struggled getting it to commit in one repo I do believe this will be the fix! TY!
@ivandimitryzyrianoff2032 жыл бұрын
Thanks for the video! It helped me solved a issue that I was struggling for a whole day
@RedhwanNacef2 жыл бұрын
Glad it helped!
@krisculin9679 Жыл бұрын
This was a very nice beginner's look at submodules. Thank you.
@RedhwanNacef Жыл бұрын
Glad it was helpful!
@richardbaumgartel9 ай бұрын
For me it was a little bit confusing, that the name of the "normal repository" contains the word submodule and the submodule itself didn't. I had to wrap my head around this couple of times but could have been just me. Other then that: Great explanation!
@BrocchiRodrigoАй бұрын
I enjoyed the content! It helped me a lot with a project I'm working on with some colleagues. Very nice!
@gregormurray31411 ай бұрын
Thank you from a fellow scot, i am messing about with robot programming and need to share python and nodejs code between the code running on the robot and the code running on the desktop this gave me the overview i needed to realise that submodules were the elegant solution i needed. So many other options i have tried just gave me a major headache.
@IreshDissanayakaM2 жыл бұрын
This was great! Nice explanation. Now I can start using git submodules.
@RedhwanNacef2 жыл бұрын
Thanks, glad it helped! 🙂
@Quacky_Batak2 жыл бұрын
Great tutorial, concise and great explanation. Thanks for showing all the other tutorials name in this video. Earned a sub 👍
@RedhwanNacef2 жыл бұрын
Thanks for the feedback and the sub. 🙂
@erniepasveer8027Ай бұрын
Clear and concise. Good presentation style and technique.
@maitreverge11 ай бұрын
This is a precious video, thanks for clarifying this subject !
@charan775 Жыл бұрын
best tutorial for submodule concept
@RedhwanNacef Жыл бұрын
Glad you liked it, thanks!
@Sunil_KumarDas Жыл бұрын
0.75 Playback speed + focus helps.
@RedhwanNacef Жыл бұрын
👍🏽
@_dinesh2 жыл бұрын
Precise and straight to the point. Thank you so much. ❣
@RedhwanNacef2 жыл бұрын
Glad you liked it 😊
@tonyjaradev2 жыл бұрын
Also this is amazing for managing typescript between projects (I think, gonna try now) Thank you so much!
@RedhwanNacef2 жыл бұрын
Hope it goes well! Anytime 🙂
@alexleung8429 ай бұрын
Best git submodules tutorial I've seen
@danielvega646 Жыл бұрын
Neato! Amazing explanation, thanks a lot. Greetings from Colombia. Keep it up!
@RedhwanNacef Жыл бұрын
Hello Colombia! Glad you enjoyed it 😊
@gpeta42 Жыл бұрын
Thank's you man 🤝, very useful
@RedhwanNacef Жыл бұрын
You're welcome 👍
@theneilpowers2 жыл бұрын
Excellent tutorial. Answered all my questions and more.
@RedhwanNacef2 жыл бұрын
Thanks, glad it helped.
@anuragchauhan5170 Жыл бұрын
Very well done, awesome tutorial, clean and precise :)
@RedhwanNacef Жыл бұрын
Thanks a lot!
@juneroyd.quinimon4952 жыл бұрын
Thank you for the video tutorial, it helps me a lot! keep up
@RedhwanNacef2 жыл бұрын
Glad it helped!
@LewisCampbellTech2 жыл бұрын
Good explanation. Last time I had to share a unit of in-house code between two projects I went with the internal NPM package, which was a bit of a nightmare to set up, deal with special keys etc etc. This would have been cleaner.
@RedhwanNacef2 жыл бұрын
Thanks! Yea I have done the exact same thing before, always good to better understand the alternatives. 🙂
@l.2432 жыл бұрын
Thanks for the video, it explains the matter clearly.
@RedhwanNacef2 жыл бұрын
Glad it was helpful!
@patryktraczyk32463 жыл бұрын
Really good explanation! Great video, thanks for it!
@RedhwanNacef3 жыл бұрын
Thanks, glad it was helpful!
@baatar6 ай бұрын
9:00 if you have cloned your git repo but need to install the submodule, the command is "git submodule update --init"
@Squirrelies18 ай бұрын
Well presented, clear, and informative! Great job! Thank you. :)
@import-ai2 жыл бұрын
Brilliant explanation. Thank you so much!
@RedhwanNacef2 жыл бұрын
Thanks! 🙂
@davidkind95873 жыл бұрын
great explanation, thanks
@RedhwanNacef3 жыл бұрын
Thank you.
@habibmosavi5 ай бұрын
Very simple and clear, thanks man!
@hussainshaik4390 Жыл бұрын
wow simple and yet all i needed
@RedhwanNacef Жыл бұрын
Thank you 😊
@stephencovrig8373 Жыл бұрын
Awesome tutorial
@RedhwanNacef Жыл бұрын
Thanks!
@lifeisbeautifu14 ай бұрын
Amazing, thank you!
@aravindmuniraj-l1f21 күн бұрын
clean and clear
@ricardomonicat7564 Жыл бұрын
Clean and usefull explanations. Thank you!!!.
@RedhwanNacef Жыл бұрын
Glad you liked it!
@senr4in7 ай бұрын
This is helpful, thanks
@iambiswajitsahoo Жыл бұрын
Thank you very much for making this video ☺️
@RedhwanNacef Жыл бұрын
Thank you very much for watching 😊
@JimmyWorld2 жыл бұрын
Excellent explanation. Thanks.
@RedhwanNacef2 жыл бұрын
Glad it was helpful!
@marmalamuc2 жыл бұрын
Your video really simplified this process for me! One question though: In other videos & articles, I've seen people say that, in order to incorporate changes from the submodule's repo, you have to run `git submodule update --remote` in the superproject repo before adding/committing/pushing. It looks like you didn't do that here, but everything worked fine. Do you know if `git submodule update --remote` is necessary?
@RedhwanNacef2 жыл бұрын
Glad it helped. The reason I did not need that command here is because I updated the submodule directly from within the parent project. So there were no other changes in the remote. If for example a colleague had updated the submodule else where, my local copy would not know about that, so I would need to ensure it is updated before developing. One way to do it is with the command `git submodule update --remote`, the other would be to `cd` into the submodule repo, checkout master and just do a git pull. Hopefully that makes sense?
@cthulhu7397 Жыл бұрын
clearly explained, thank you
@RedhwanNacef Жыл бұрын
You're welcome
@Stonk5331 Жыл бұрын
Clear & Precise!
@RedhwanNacef Жыл бұрын
Glad you think so!
@JuanPortalG Жыл бұрын
Thanks, man!
@RedhwanNacef Жыл бұрын
No problem!
@refused_hc78826 ай бұрын
Thanks for your time, totally helpful!
@jimbobear1812 Жыл бұрын
This guy rocks. Thank you!
@RedhwanNacef Жыл бұрын
Cheers!
@sonnix31 Жыл бұрын
Very nice, thank you
@RedhwanNacef Жыл бұрын
Thanks and you're welcome 😊
@cerealkiller66758 ай бұрын
Perfect ! Thanks for this tutorial
@matheusglauber4261 Жыл бұрын
Very good video, very helpful, tks
@RedhwanNacef Жыл бұрын
Thanks
@joe_j Жыл бұрын
This was really helpful .Than you
@RedhwanNacef Жыл бұрын
Glad to hear that, thanks.
@azharlihan9 ай бұрын
Thanks for the explanation. Simple and I can easily understand. But how to remove submodule completely from main repository? For example, remove youtube-tutorial submodule from git-submodule-tutorial repository?
@user-kc3gl9dj2w Жыл бұрын
Nice explanation.
@RedhwanNacef Жыл бұрын
Thanks
@eryks22692 жыл бұрын
Good explanation, thank you.
@RedhwanNacef2 жыл бұрын
Glad it was helpful!
@Blast-Forward2 жыл бұрын
Thanks for the explanation.
@RedhwanNacef2 жыл бұрын
You're welcome!
@androth150221 күн бұрын
can you make submodules out of specific folders in a repository?
@realscreen7735 Жыл бұрын
U made some changes to the local repo and comitted them from which u got the submodule. How is git able to figure out that there are changes in the local repo when it is pointing to the remote url and not the local repo from which we got the submodule?
@RedhwanNacef Жыл бұрын
Good question, if you remember we have a ".gitmodules" that has a path to the submodule. This is telling git where to track the local changes. This is how it knows there are changes in the local repo. Hope that makes sense.
@user-vs5qs2mr1y5 ай бұрын
but if we have more than one submodule and we want to downoloaded only a specific submodule into the main repo ?
@projetoforum76852 жыл бұрын
Thank you so much, excellent tutorial
@RedhwanNacef2 жыл бұрын
You're very welcome, glad you liked it.
@MayureshKadu9 ай бұрын
Very useful and well explained. Thanks
@eric-ampire8 ай бұрын
Great explanation
@DjSeymur Жыл бұрын
Is there a way to do this with branches in the same repository instead of two different repositories ?
@RedhwanNacef Жыл бұрын
Not sure, I have never thought to do that. You could always try add the path/url and see if it works?
@MaherKheder33 жыл бұрын
thank you for Video. question: how you can show the options in command line like in min : 14:02 ?
@RedhwanNacef3 жыл бұрын
Anytime. I use zsh with the git plugin: github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git. which gives me that functionality :)
@batfos2 жыл бұрын
Thank you
@RedhwanNacef2 жыл бұрын
You’re welcome
@stanislavlyu18279 ай бұрын
Thank you for the tutorial. I have a question, what about private submodule repo?
@GTsurwa Жыл бұрын
Fantastic Explanation. Many Thanks.
@RedhwanNacef Жыл бұрын
Thanks, you're welcome!
@kadiryumlu6 ай бұрын
Should I create a seperate repo for submodule?
@azir8930 Жыл бұрын
❤🔥
@RedhwanNacef Жыл бұрын
👌🏼
@MohammadhosseinMalekpour2 ай бұрын
Great, thanks man.
@praveenkore842 Жыл бұрын
nice info brother
@RedhwanNacef Жыл бұрын
Thanks!
@belphegor697926 күн бұрын
Thank you this was wery helpful
@luizcesarmerjandepaula60673 жыл бұрын
Nice! Thank you for the content
@RedhwanNacef3 жыл бұрын
Thanks, my pleasure!
@ashwinswain1649 Жыл бұрын
Hi, I am not able to see the submodule files i guess now i got the answer why.....thanks for that..but what if i want to undo and make it invisible again? also how can i add a version tag to the submodules and how can i use a feature branch of repo A as a submodule inside repo B so i can run a github action on B
@RedhwanNacef Жыл бұрын
You're welcome. I wonder if the "deinit" command is what you are looking for here? Tags would be added the same as any other repo. In terms of feature branch you can specify the branch in the .gitmodules file. Hopefully that helps!
@danumichael21432 жыл бұрын
Great video
@RedhwanNacef2 жыл бұрын
Thanks
@rwboshae3 жыл бұрын
Very good tutorial, thanks.
@RedhwanNacef3 жыл бұрын
Thank you and you’re welcome 😊
@sameerakhatoon95082 жыл бұрын
this was lit, ty sm
@RedhwanNacef2 жыл бұрын
Glad you liked it
@mhasadi783 жыл бұрын
Good tutorial, appreciated.
@RedhwanNacef3 жыл бұрын
Thank you.
@EdwinFairchild2 жыл бұрын
howcome everytime i run submodules update, i go look at my submodule and it checksout the commit (now outdated) that i originally made the project with....thought update would fetch the latest commit for me. So im finding to stay up to date I have to go checkout main from my submodule. How to I make my submodule always update to main not the commit i started my repo with
@RedhwanNacef2 жыл бұрын
I believe submodule update will only update according to the local remote. Have you tried adding the --remote flag? That should actually fetch and update for you (making the submodule is on the main branch too).
@fredrikwaldt1942 жыл бұрын
You know the desciprition of the video could really use a short summary of the commands, so that i dont have to look for them. Great video thou!
@RedhwanNacef2 жыл бұрын
Thanks for the feedback!
@CodeProps2 жыл бұрын
This was really helpful
@RedhwanNacef2 жыл бұрын
Great to hear 😊
@nicolasmenescardi40773 жыл бұрын
great video. Thanks!
@RedhwanNacef3 жыл бұрын
Glad you liked it! Thanks 😊
@markrussell55873 жыл бұрын
that was great thanks
@RedhwanNacef3 жыл бұрын
You’re welcome 😊
@michaelakin766 Жыл бұрын
Great video. Question for you. I have a git repo that I need to break into different repos with submodules. Do you know of a way to do that and keep the git history for each new repo?
@RedhwanNacef Жыл бұрын
Thanks. Not sure if there is an easy way to do that, I remember hearing about a project where this was done but it was all manual with cherry picking etc. There may be some tools out there that might help with this. Good luck!
@taylorfritz66483 жыл бұрын
This was so helpful! I do have a question though... I made a change in my submodule repo but the change never showed up in my parent repo. Is there where I need to explicitly ask git to go update to the latest commit in that submodule?
@RedhwanNacef3 жыл бұрын
Thank you! Thats right (assuming you have committed and pushed the changes in the submodule). I usually "cd" in to the submodule from the parent repo and git pull from there, but you can also use the submodule commands from the parent directory and that should do the trick. 👍🏽
@taylorfritz66483 жыл бұрын
@@RedhwanNacef Thank you so much for responding! A little bit after I asked, I ended up figuring out how to pull in those changes and then push/commit those changes to the submodule as a part of the parent repo. You said it very clearly here too, to track exactly what I was doing! Thanks again! :)
@RedhwanNacef3 жыл бұрын
Anytime 😊
@devstefancho2 жыл бұрын
command summary git submodule add {child-repo-url} # add submodules (this will create .gitmodules) git pull --recurse-submodules # bring submodule's files git config submodule.recurse true # always --recurse-submodules git clone {parent-repo-url} # clone your parent repo which have submodules git submodule update --init # bring submodule files to this repo
@RedhwanNacef2 жыл бұрын
Thanks for the summary!
@AlexSmith-fs6ro3 жыл бұрын
Can you specify a submodule to reference a branch rather than a commit hash? The idea is to work on that submodule branch, ie new commits, push, pull/fetch, rebase. Then merge the submodule branch into, say, master. Can you specify a tag for the submodule?
@RedhwanNacef3 жыл бұрын
I don't think you can, it will always reference a commit, however, you can specify a commit hash from a different branch. For example, you can specify a branch in the .gitmodules file and it will use the latest commit hash from the branch. You can still do the workflow you have specified, you will just need to make sure you use the right commit hash once merged. I don't you can specify a tag either, but again a tag will always be linked to a commit hash so I think you could use that commit. Hope that helps!
@CoderHarsh5 ай бұрын
Thanks ❤
@vishekkumar31842 жыл бұрын
Hi Nice explanation!!! I have one query, if we initialize a sub-module so for which branch of sub-module project it is considered in the parent project?
@RedhwanNacef2 жыл бұрын
Thanks! You can specify the submodule branch in the .gitmodules directory, if not it defaults to the remote HEAD (which basically means it defaults to the default branch). Hope that helps!
@BaronFO2 жыл бұрын
Thanks
@RedhwanNacef2 жыл бұрын
Anytime
@BaronFO2 жыл бұрын
@@RedhwanNacef How do u handle dependencies in project with submodules? I am thinking of using Workspaces, is there any sollution u prefer?
@karankundar7276 Жыл бұрын
Can i update multiple destination repositories with one source repository while executing some git submodules command at the source repository ?
@RedhwanNacef Жыл бұрын
"git submodule update --remote" might be what you are looking for?
@Chemaclass3 жыл бұрын
Thanks a lot!
@RedhwanNacef3 жыл бұрын
Anytime!
@eduardojreis2 жыл бұрын
9:36 - Showing the branch in the command line prefix is very clever. How do you do that? Is that automatic? I am under anaconda, so I get to see the environment name, not the git branch name. Cheers,
@RedhwanNacef2 жыл бұрын
I am using a shell called 'Zsh' with 'Oh My Zsh' will lets you configure/customise all of this. It's very useful.
@dhivyadandapani7159 Жыл бұрын
Is your 'tree' command an alias? If yes, could you share the entire command for the alias?
@RedhwanNacef Жыл бұрын
It is an alias for the tool 'exa' (an 'ls' replacement). The command I run is 'exa -T -L 2 --icons'.
@HelpingHands38383 жыл бұрын
Thanks for the explanation 👍 One clarification needed... I own a repo called repo1 and it has a submodule called repo2. The repo2 has two files namely a.txt and b.txt . I want to create a new file c.txt in repo1 . I want to make sure the c.txt file should have the content of a.txt which is available under repo2 through submodule. How could I achieve this ? Any changes to a.txt in repo2 (in actual repo) also should reflect in my c.txt Hope I m not confusing... 😀
@RedhwanNacef3 жыл бұрын
Anytime :) This depends on the tech used of course and exactly what you are trying to achieve. In general, if you need c.txt to contain content from the submodule, you could add a simple script that copies that content over. Then just run this script anytime you update the submodule. (or even a script that does both). Hope that helps, but if you are looking for something more specific let me know.
@HelpingHands38383 жыл бұрын
@@RedhwanNacef thanks mate 👍... that clarifies my doubt
@judeurban1456 Жыл бұрын
Great video. I'm curious how you are displaying the options of a command inside the terminal? It's almost like a dynamic "--help" flag as you're typing out the command. Never seen this before. Is this a feature internal to PyCharm?
@RedhwanNacef Жыл бұрын
Thanks. This is not the IDE but the shell. I believe I was using zshell and oh my zsh at this point (I now use fish shell), if you search for those terms you should find what you are looking for.
@user-Mark750 Жыл бұрын
Hi, it doesn't make much sense to use always the latest commit of a library. What can I do if I want to use e.g. tag V1.0 of a lib which is one of my submodules?
@RedhwanNacef Жыл бұрын
You can just checkout that branch/tag/commit in the submodule and make sure to commit the parent module. It will only ever update if committed so that should work fine.
@blue_mustang_2 жыл бұрын
how do I delete a submodule created by accident??
@RedhwanNacef2 жыл бұрын
You should just be able to remove the .gitmodules file and all the submodule files and commit. (There may be some references in the .git directory to the submodule that you need to remove too) maybe try this: git.wiki.kernel.org/index.php/GitSubmoduleTutorial#Removal.
@Travel-2-chill2 жыл бұрын
i am unable to access components from submodule
@RedhwanNacef2 жыл бұрын
Any error message/repo you can share so I can try help?