Git Submodules Tutorial | For Beginners

  Рет қаралды 141,657

Redhwan Nacef

Redhwan Nacef

Күн бұрын

Hello! Today's video is looking at Git Submodules. Most people think badly of submodules and tend to stay away from them, but I have been using them lately and really enjoyed working with them! I hope you enjoy :)
Useful Links:
GitHub: github.com/redhwannacef/git-s...
Git Submodules: git-scm.com/book/en/v2/Git-To...
Music:
• Timeless
Huge thank you to Harris Heller for providing copyright-free music.
Timestamps:
0:00 - Intro
0:30 - What?
2:07- Why/When?
3:36 - Show me the code!
14:30 - Thank You For Watching!
------------------------
Hey everyone! My name is Redhwan Nacef (Red for short). In this channel, I'm hoping to share my thoughts on software engineering, coding, management, and all things tech. I hope you enjoy!

Пікірлер: 225
@lambertoXD
@lambertoXD 3 жыл бұрын
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!
@RedhwanNacef
@RedhwanNacef 3 жыл бұрын
You're very welcome, glad it helped! Thank you for the feedback.
@warisulimam3440
@warisulimam3440 2 жыл бұрын
Simple and precise explanations, incredibly helpful. Thank you so much!
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Thanks! Glad you enjoyed it 😊
@maitreverge
@maitreverge 9 ай бұрын
This is a precious video, thanks for clarifying this subject !
@Quacky_Batak
@Quacky_Batak 2 жыл бұрын
Great tutorial, concise and great explanation. Thanks for showing all the other tutorials name in this video. Earned a sub 👍
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Thanks for the feedback and the sub. 🙂
@ivandimitryzyrianoff203
@ivandimitryzyrianoff203 2 жыл бұрын
Thanks for the video! It helped me solved a issue that I was struggling for a whole day
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Glad it helped!
@Squirrelies1
@Squirrelies1 6 ай бұрын
Well presented, clear, and informative! Great job! Thank you. :)
@patryktraczyk3246
@patryktraczyk3246 3 жыл бұрын
Really good explanation! Great video, thanks for it!
@RedhwanNacef
@RedhwanNacef 3 жыл бұрын
Thanks, glad it was helpful!
@anuragchauhan5170
@anuragchauhan5170 Жыл бұрын
Very well done, awesome tutorial, clean and precise :)
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Thanks a lot!
@krisculin9679
@krisculin9679 Жыл бұрын
This was a very nice beginner's look at submodules. Thank you.
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Glad it was helpful!
@habibmosavi
@habibmosavi 3 ай бұрын
Very simple and clear, thanks man!
@alexleung842
@alexleung842 7 ай бұрын
Best git submodules tutorial I've seen
@IreshDissanayakaM
@IreshDissanayakaM 2 жыл бұрын
This was great! Nice explanation. Now I can start using git submodules.
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Thanks, glad it helped! 🙂
@theneilpowers
@theneilpowers 2 жыл бұрын
Excellent tutorial. Answered all my questions and more.
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Thanks, glad it helped.
@cerealkiller6675
@cerealkiller6675 6 ай бұрын
Perfect ! Thanks for this tutorial
@import-ai
@import-ai Жыл бұрын
Brilliant explanation. Thank you so much!
@RedhwanNacef
@RedhwanNacef Жыл бұрын
Thanks! 🙂
@tonyjaradev
@tonyjaradev 2 жыл бұрын
Also this is amazing for managing typescript between projects (I think, gonna try now) Thank you so much!
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Hope it goes well! Anytime 🙂
@danielvega646
@danielvega646 Жыл бұрын
Neato! Amazing explanation, thanks a lot. Greetings from Colombia. Keep it up!
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Hello Colombia! Glad you enjoyed it 😊
@MayureshKadu
@MayureshKadu 7 ай бұрын
Very useful and well explained. Thanks
@gregormurray314
@gregormurray314 9 ай бұрын
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.
@refused_hc7882
@refused_hc7882 4 ай бұрын
Thanks for your time, totally helpful!
@nikitakrasnytskyi
@nikitakrasnytskyi 4 ай бұрын
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.
@lifeisbeautifu1
@lifeisbeautifu1 2 ай бұрын
Amazing, thank you!
@ricardomonicat7564
@ricardomonicat7564 10 ай бұрын
Clean and usefull explanations. Thank you!!!.
@RedhwanNacef
@RedhwanNacef 10 ай бұрын
Glad you liked it!
@l.243
@l.243 2 жыл бұрын
Thanks for the video, it explains the matter clearly.
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Glad it was helpful!
@gpeta42
@gpeta42 11 ай бұрын
Thank's you man 🤝, very useful
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
You're welcome 👍
@luizcesarmerjandepaula6067
@luizcesarmerjandepaula6067 2 жыл бұрын
Nice! Thank you for the content
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Thanks, my pleasure!
@isholaoluwatomisin1906
@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
@EddieDemon Жыл бұрын
Biggest question mark I was left with, thanks for answering!
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Thanks for the additional information.
@JayJay-ki4mi
@JayJay-ki4mi 2 жыл бұрын
Redhwan: "This will take a few seconds" Boost: "Go grab a coffee"
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
😂
@JimmyWorld
@JimmyWorld 2 жыл бұрын
Excellent explanation. Thanks.
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Glad it was helpful!
@_dinesh
@_dinesh 2 жыл бұрын
Precise and straight to the point. Thank you so much. ❣
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Glad you liked it 😊
@thaynethetigerbarnes
@thaynethetigerbarnes 28 күн бұрын
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!
@hussainshaik4390
@hussainshaik4390 Жыл бұрын
wow simple and yet all i needed
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Thank you 😊
@iambiswajitsahoo
@iambiswajitsahoo Жыл бұрын
Thank you very much for making this video ☺️
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Thank you very much for watching 😊
@davidkind9587
@davidkind9587 3 жыл бұрын
great explanation, thanks
@RedhwanNacef
@RedhwanNacef 3 жыл бұрын
Thank you.
@GTsurwa
@GTsurwa Жыл бұрын
Fantastic Explanation. Many Thanks.
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Thanks, you're welcome!
@Stonk5331
@Stonk5331 Жыл бұрын
Clear & Precise!
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Glad you think so!
@rwboshae
@rwboshae 2 жыл бұрын
Very good tutorial, thanks.
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Thank you and you’re welcome 😊
@projetoforum7685
@projetoforum7685 2 жыл бұрын
Thank you so much, excellent tutorial
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
You're very welcome, glad you liked it.
@mhasadi78
@mhasadi78 2 жыл бұрын
Good tutorial, appreciated.
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Thank you.
@senr4in
@senr4in 5 ай бұрын
This is helpful, thanks
@cthulhu7397
@cthulhu7397 Жыл бұрын
clearly explained, thank you
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
You're welcome
@marmalamuc
@marmalamuc 2 жыл бұрын
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?
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
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?
@jimbobear1812
@jimbobear1812 Жыл бұрын
This guy rocks. Thank you!
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Cheers!
@eryks2269
@eryks2269 2 жыл бұрын
Good explanation, thank you.
@RedhwanNacef
@RedhwanNacef Жыл бұрын
Glad it was helpful!
@MohammadhosseinMalekpour
@MohammadhosseinMalekpour 4 күн бұрын
Great, thanks man.
@LewisCampbellTech
@LewisCampbellTech 2 жыл бұрын
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.
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Thanks! Yea I have done the exact same thing before, always good to better understand the alternatives. 🙂
@charan775
@charan775 10 ай бұрын
best tutorial for submodule concept
@RedhwanNacef
@RedhwanNacef 10 ай бұрын
Glad you liked it, thanks!
@juneroyd.quinimon495
@juneroyd.quinimon495 2 жыл бұрын
Thank you for the video tutorial, it helps me a lot! keep up
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Glad it helped!
@nicolasmenescardi4077
@nicolasmenescardi4077 2 жыл бұрын
great video. Thanks!
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Glad you liked it! Thanks 😊
@Ultrajuiced
@Ultrajuiced 2 жыл бұрын
Thanks for the explanation.
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
You're welcome!
@joe_j
@joe_j Жыл бұрын
This was really helpful .Than you
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Glad to hear that, thanks.
@sonnix31
@sonnix31 Жыл бұрын
Very nice, thank you
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Thanks and you're welcome 😊
@CodeProps
@CodeProps 2 жыл бұрын
This was really helpful
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Great to hear 😊
@eric-ampire
@eric-ampire 6 ай бұрын
Great explanation
@stephencovrig8373
@stephencovrig8373 Жыл бұрын
Awesome tutorial
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Thanks!
@osys7832
@osys7832 11 ай бұрын
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
@RedhwanNacef 11 ай бұрын
You got it! The .gitmodules file is probably a good thing to remember too when summing up.
@JuanPortalG
@JuanPortalG Жыл бұрын
Thanks, man!
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
No problem!
@matheusglauber4261
@matheusglauber4261 Жыл бұрын
Very good video, very helpful, tks
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Thanks
@richardbaumgartel
@richardbaumgartel 7 ай бұрын
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!
@stanislavlyu1827
@stanislavlyu1827 7 ай бұрын
Thank you for the tutorial. I have a question, what about private submodule repo?
@judeurban1456
@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
@RedhwanNacef 11 ай бұрын
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.
@michaelakin766
@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
@RedhwanNacef 11 ай бұрын
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!
@sameerakhatoon9508
@sameerakhatoon9508 2 жыл бұрын
this was lit, ty sm
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Glad you liked it
@vishekkumar3184
@vishekkumar3184 2 жыл бұрын
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?
@RedhwanNacef
@RedhwanNacef Жыл бұрын
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!
@Sunil_KumarDas
@Sunil_KumarDas Жыл бұрын
0.75 Playback speed + focus helps.
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
👍🏽
@taylorfritz6648
@taylorfritz6648 2 жыл бұрын
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?
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
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. 👍🏽
@taylorfritz6648
@taylorfritz6648 2 жыл бұрын
@@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! :)
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Anytime 😊
@batfos
@batfos 2 жыл бұрын
Thank you
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
You’re welcome
@markrussell5587
@markrussell5587 3 жыл бұрын
that was great thanks
@RedhwanNacef
@RedhwanNacef 3 жыл бұрын
You’re welcome 😊
@user-kc3gl9dj2w
@user-kc3gl9dj2w Жыл бұрын
Nice explanation.
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Thanks
@Chemaclass
@Chemaclass 3 жыл бұрын
Thanks a lot!
@RedhwanNacef
@RedhwanNacef 3 жыл бұрын
Anytime!
@MaherKheder3
@MaherKheder3 3 жыл бұрын
thank you for Video. question: how you can show the options in command line like in min : 14:02 ?
@RedhwanNacef
@RedhwanNacef 3 жыл бұрын
Anytime. I use zsh with the git plugin: github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git. which gives me that functionality :)
@CoderHarsh
@CoderHarsh 3 ай бұрын
Thanks ❤
@danumichael2143
@danumichael2143 2 жыл бұрын
Great video
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Thanks
@DjSeymur
@DjSeymur Жыл бұрын
Is there a way to do this with branches in the same repository instead of two different repositories ?
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Not sure, I have never thought to do that. You could always try add the path/url and see if it works?
@EdwinFairchild
@EdwinFairchild 2 жыл бұрын
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
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
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).
@AlexSmith-fs6ro
@AlexSmith-fs6ro 3 жыл бұрын
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?
@RedhwanNacef
@RedhwanNacef 3 жыл бұрын
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!
@azharlihan
@azharlihan 7 ай бұрын
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?
@praveenkore842
@praveenkore842 Жыл бұрын
nice info brother
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
Thanks!
@danielcorzo7498
@danielcorzo7498 2 жыл бұрын
Great Video!! 👍👍 What if I'm cloning a third party tool that I'm not going to be making commits to, or very small changes at most? Can I just pull the commits to that repo?
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Thank you! Yea the same approach can used with any repository as long as it is publicly accessible. Not sure if you have a specific use case in mind?
@danielcorzo7498
@danielcorzo7498 2 жыл бұрын
@@RedhwanNacef I was thinking about receiving any changes they make in their repo. I may not make any changes to that third party tool myself. Forvige me, I'm still a noob 🙈
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Yea that makes sense. Git submodules should work fine for that. No worries, you will be a pro in no time!
@HelpingHands3838
@HelpingHands3838 3 жыл бұрын
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... 😀
@RedhwanNacef
@RedhwanNacef 3 жыл бұрын
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.
@HelpingHands3838
@HelpingHands3838 3 жыл бұрын
@@RedhwanNacef thanks mate 👍... that clarifies my doubt
@kadiryumlu
@kadiryumlu 4 ай бұрын
Should I create a seperate repo for submodule?
@azir8930
@azir8930 Жыл бұрын
❤‍🔥
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
👌🏼
@baatar
@baatar 4 ай бұрын
9:00 if you have cloned your git repo but need to install the submodule, the command is "git submodule update --init"
@bhuvaneshsankaran7670
@bhuvaneshsankaran7670 3 жыл бұрын
Can we can manage the Pull Request by updating submodule from main repo ?
@RedhwanNacef
@RedhwanNacef 3 жыл бұрын
If I understand you correctly, yes. Because you can update and push any branch from the main repo, then any PR connected will be updated accordingly.
@BaronFO
@BaronFO 2 жыл бұрын
Thanks
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Anytime
@BaronFO
@BaronFO 2 жыл бұрын
@@RedhwanNacef How do u handle dependencies in project with submodules? I am thinking of using Workspaces, is there any sollution u prefer?
@user-vs5qs2mr1y
@user-vs5qs2mr1y 3 ай бұрын
but if we have more than one submodule and we want to downoloaded only a specific submodule into the main repo ?
@eduardojreis
@eduardojreis 2 жыл бұрын
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,
@RedhwanNacef
@RedhwanNacef Жыл бұрын
I am using a shell called 'Zsh' with 'Oh My Zsh' will lets you configure/customise all of this. It's very useful.
@karankundar7276
@karankundar7276 Жыл бұрын
Can i update multiple destination repositories with one source repository while executing some git submodules command at the source repository ?
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
"git submodule update --remote" might be what you are looking for?
@user-Mark750
@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
@RedhwanNacef 11 ай бұрын
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.
@realscreen7735
@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
@RedhwanNacef 11 ай бұрын
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.
@CvetanSimsic
@CvetanSimsic 2 жыл бұрын
What does git submodule point to by default? I know exact answer is certain commit hash, but how is that chosen and at which time? Can it be configured? How exectly does process of updating submodule go.
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
If I remember correctly, it will point to either the remote HEAD by default. You can specify a branch in the .gitmodules files too to override this. Then from that branch it will take the latest commit hash. In terms of what time, it will be at the time of running the command. Does that help?
@okey1317
@okey1317 Жыл бұрын
is it possible to configure my submodule so that it always points to the latest commit on a specific branch?
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
You can add a branch property to the .gitmodules file (e.g. "branch = some-branch"). By default it is pointing to the default branch of the repo. I think that might be what you are looking for.
@ashwinswain1649
@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
@RedhwanNacef 11 ай бұрын
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!
@meerasridhar9570
@meerasridhar9570 3 жыл бұрын
can we modify the codes in submodules. i have a repo with submodule pointing to other repo.i want to modify some codes in submodule in my repo only.i dont want to alter the code of the repo it is pointing to. Repo1 has submodule 1. submodule1 is pointing to Repo2 commits. now i want to modify the submodule1 in the Repo1 only not in Repo2
@RedhwanNacef
@RedhwanNacef 3 жыл бұрын
I think this is doable but not in the way you have suggested, i.e. you cannot add changes for the submodule and store them in Repo1, because Repo1 does not track any changes to the submodule other than the commit it is pointing to. An approach could be to create a a branch in a fork of repo 2 for example. That way you can have your code/commits there without altering the original repo, but this means you will have to manually ensure any new updates are merged/rebased on top of your custom changes. There may be other ways of achieving what you want without modifying the code directly but this is completely depending on the structure of the repo itself. Hope this helps.
@anonanon3066
@anonanon3066 3 жыл бұрын
Can i "check out" a single directory? Let's say i just want the "source" directory of another repository. I don't need all the other mambo jambo such as tests or documentation or readmes, but still have the possibility to keep it up to date via git
@RedhwanNacef
@RedhwanNacef 3 жыл бұрын
Hmm, I don't think that is possible unfortunately, I believe it is just full repositories.
@windmaomao
@windmaomao Жыл бұрын
Thanks for the video. However I think the real trouble is at the Pull Request, for instance, how do you take a look at the commits of one repo without another repo, and it seems to me you have to have two Pull Request from two repos to be merged in at the SAME time? isn't this crazy?
@RedhwanNacef
@RedhwanNacef 11 ай бұрын
You're welcome. The idea is that these should still move independently. So you or someone else may work on the module separately. Then once ready you would make changes to the parent repo. This is the same workflow as working with an external library, just without the need of maintaining and publishing versions. Hope that makes sense.
@aelgames8889
@aelgames8889 3 жыл бұрын
Hi there , can you create a new branch ... and try to edit any fiele on the git sobmodules .. and than pusch it ... iits not works for me ?
@RedhwanNacef
@RedhwanNacef 3 жыл бұрын
If I understand you correctly, that will not work. When you edit a file in the sub repository, the changes wont be reflected in the root repository, only in the submodule itself. Does that help?
@misohoongry
@misohoongry 2 жыл бұрын
Hi quick qn, what is the ide youre using in 3:52?
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
IntelliJ IDEA :)
@dogukanvaris7224
@dogukanvaris7224 2 жыл бұрын
Hi, if I want to create a main repository called Netlify projects, how can I publish the projects in it to Netlify? You know, Netlify sees itself directly, not the contents of the repository.
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Hi, I'm afraid I don't really know much about Netlify so wont be able to help here. A quick look at the documentation (docs.netlify.com/configure-builds/repo-permissions-linking/#git-submodules) seems to suggest it should work with submodules but I am not sure sorry!
@dogukanvaris7224
@dogukanvaris7224 2 жыл бұрын
@@RedhwanNacef Thank you for the research.
@fredrikwaldt194
@fredrikwaldt194 2 жыл бұрын
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!
@RedhwanNacef
@RedhwanNacef 2 жыл бұрын
Thanks for the feedback!
How to git submodule tutorial
24:59
Cameron McKenzie
Рет қаралды 48 М.
Git MERGE vs REBASE: The Definitive Guide
9:39
The Modern Coder
Рет қаралды 86 М.
Final muy inesperado 🥹
00:48
Juan De Dios Pantoja
Рет қаралды 19 МЛН
Vivaan  Tanya once again pranked Papa 🤣😇🤣
00:10
seema lamba
Рет қаралды 22 МЛН
What is a bare Git repo and why you need them
5:55
Engineer Man
Рет қаралды 65 М.
11. Git Tutorial - Hooks in git
10:02
Mafia Codes
Рет қаралды 4,1 М.
Git Tutorial For Dummies
19:25
Nick White
Рет қаралды 1 МЛН
Git Worktree Tutorial | The Most Underrated Git Command?
6:29
Redhwan Nacef
Рет қаралды 13 М.
Git and GitHub for Beginners - Crash Course
1:08:30
freeCodeCamp.org
Рет қаралды 4 МЛН
Complete GIT in 1 video
3:43:17
Hitesh Choudhary
Рет қаралды 69 М.
Introduction to Git - Remotes
31:16
David Mahler
Рет қаралды 163 М.
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 52 МЛН
💅🏻Айфон vs Андроид🤮
0:20
Бутылочка
Рет қаралды 736 М.
Will the battery emit smoke if it rotates rapidly?
0:11
Meaningful Cartoons 183
Рет қаралды 32 МЛН