Git Internals - Diff and Patch (merge & rebase series - part 1)

Поделиться
HTML-код
  • Опубликовано: 18 янв 2025

Комментарии • 54

  • @nnii-rn7co
    @nnii-rn7co Год назад +6

    Sir, in today's world, it is so common that RUclips videos and posts online are shallow content, all copied from from someone else's channel or site, and many times a waste of my time. But this video has some original content, adds much to the table, and explains well even the hardest details. Thank you for making quality content to the Internet. You earned a sub in the first 6 minutes.

    • @BriefVid
      @BriefVid  Год назад +1

      Thank you so much for this kind and thoughtful comment, you made my day 🙏🏻

  • @pacificdash
    @pacificdash 2 дня назад

    This is truly some of the best technical content on YT. Everything: the actual info content, the diagrams and animations, the effort put into pre-prod with good, simple, yet rich examples. Really nice one. I have only one piece of feedback on what can be improved: the ads (for me at least) are so frequent I keep losing my place mentally. I’ve actually never seen a yt video with such frequent ads. Hey if they’re paying your bills: worth it. Just something to know

    • @BriefVid
      @BriefVid  6 часов назад

      Thank you for the kind words and the feedback! Honestly I don't control the frequency of the ads - so I can't do much about it :(
      Thanks a lot again for the kind feedback, it's really touching and motivating

  • @smibssmibs
    @smibssmibs Год назад +4

    Definitely the best advanced git lessons. It grabs essential building blocks and concepts, clearly explains them and then builds a castle of real understanding of what is going on on it.
    Excellent work. You really love git and it's internals + have talent to explain things clearly.

    • @BriefVid
      @BriefVid  Год назад

      Thank you so much for your kind response, it really motivates me to create more content 🙏🏻

  • @randomsde4390
    @randomsde4390 Год назад +1

    Saw this from my RUclips recommendation, and immediately clicked in to watch E2E. Great content as usual!

    • @BriefVid
      @BriefVid  Год назад

      Thank you so much! Future parts are coming soon 💪🏻

  • @notgreen11
    @notgreen11 Год назад +1

    These are the BEST git videos I have EVER seen. Months of trying to understand but now I can finally handle my git histories with confidence.

    • @BriefVid
      @BriefVid  Год назад +1

      Thank you so much for your kind words! You made my day

  • @caiofelipe2117
    @caiofelipe2117 Год назад +2

    One of the best git teacher that I have ever seen :)

    • @BriefVid
      @BriefVid  Год назад

      Wow! Thank you for this kind comment 🙏🏻

  • @lisowisko
    @lisowisko Год назад +2

    I don't understand what you did at 32:02 - you added two new lines and immediately after that did git reset --hard, so it deleted those changes and they were never used, even in the patch as you made it earlier, right? It confused me a little. Btw, I love your git explanation videos, thank you so much for making them!

    • @BriefVid
      @BriefVid  Год назад +1

      Thank you @ania!
      I understand why it confused it, in retrospect - it doesn't add to the explanation so I might just erase this step. Thank you for pointing this out!

    • @yurkoflisk
      @yurkoflisk 7 месяцев назад

      ​@@BriefVid I think it still should be clarified a bit. My understanding:
      The reason it worked in that example is that after "git reset" the line numbers in the patch were correct wrt line numbers in the file. It has nothing to do with "checking 3 lines", which is btw actually not what "git apply" does by default. As per documentation, it ignores *no* context by default (i.e. without -C), so it checks line numbers and all provided context lines (this is also consistent with written explanation for -C which you provided earlier, i.e. that it's *neccessary* for ignoring line numbers). And, it's the *diff* that produces 3 lines of context around changes by default (which can be overridden by -U).

  • @bodeesornkosullawrit6918
    @bodeesornkosullawrit6918 Год назад +2

    Great video on teaching Git! The way you explained the concepts was very thorough and easy to understand, and the use of visuals was particularly helpful in making the more complex topics easier to follow.
    I was pleasantly surprised to find such high-quality content for free on RUclips. In fact, I found this video to be even better than some paid courses I've taken on the same topic.
    I want to express my sincere gratitude and respect for the effort and expertise you put into creating this video. Your teaching style is engaging and clear, making the video both informative and enjoyable to watch. Thank you for sharing your knowledge with us and providing such a valuable resource for the community. I look forward to watching more of your content in the future!

    • @BriefVid
      @BriefVid  Год назад

      Wow, thank you so much for this kind, thorough, and inspiring response 🙏🏻

  • @magno5157
    @magno5157 8 месяцев назад +2

    This is an excellent companion video to the official git-diff documentation. As excellent as this topic has been explained in this video, I don't recommend jumping into it without first *carefully* reading the documentation, especially the parts of the documentation that use the term "relative", which unfortunately isn't used in this video. Anyway, this video is still excellent but it's not for someone who hasn't read the documentation.

  • @mohamedbelkacem5366
    @mohamedbelkacem5366 Год назад +1

    Best content on git I have seen online(including paid content). I have been waiting for new git videos on this channel a year 😅 ago, and finally here they are. I can't wait to see more your GREAT videos. Thank you alot

    • @BriefVid
      @BriefVid  Год назад

      Thank you so much for your kind words! They really boost my motivation, and indeed I am in the final editing phase for part 2 of this series - coming out soon 🙏🏻

  • @flaviohenrique5294
    @flaviohenrique5294 5 месяцев назад +1

    Valeu!

    • @BriefVid
      @BriefVid  5 месяцев назад

      Wow, thank you so much!

    • @flaviohenrique5294
      @flaviohenrique5294 5 месяцев назад +1

      ​@@BriefVidthank you. Your content is amazing. I will try send more as a away of thankness. I hope you continue with the awesome content.

    • @BriefVid
      @BriefVid  5 месяцев назад

      @@flaviohenrique5294 that'd be amazing. Really, thank you 🙏🏻🙏🏻🙏🏻🙏🏻

  • @wojciechbojewski9442
    @wojciechbojewski9442 Год назад +3

    Great series!

  • @abhitejamandava1619
    @abhitejamandava1619 Год назад +2

    Great job! Thank you so much

    • @BriefVid
      @BriefVid  Год назад

      Glad it was helpful!

  • @pepperoniy
    @pepperoniy Год назад +1

    Thanks for the new video on git! Looking forward to the next parts

    • @BriefVid
      @BriefVid  Год назад +1

      Thanks for watching! I am working on the next parts :)

  • @TheodoreRavindranath
    @TheodoreRavindranath Год назад +1

    Amazing videos.. thanks for sharing! It would be cool to know how forking works internally, and how PR gets merged, and how fork-sync works ;-)

    • @BriefVid
      @BriefVid  Год назад

      Thanks for your comment, and that's great suggestion! I will cover that in the future.
      Regarding "how PR gets merged" - the interesting parts are covered in part 2-3 of this series.

  • @ricardo-ne2ld
    @ricardo-ne2ld Год назад +1

    great video, looking forward to part 2

    • @BriefVid
      @BriefVid  Год назад

      Thank you @ricardo-ne2Id! I'm working on it, coming soon!

  • @kthamim7552
    @kthamim7552 4 месяца назад +1

    my doubt is if you are creatina a pathch for a file called newfile.patch then you are doing a hard reset
    while you are doing hard reset it change the head what ever we want ,so that time patch file gets erased so how it able to take that patch file in to the current files and get added ??

    • @BriefVid
      @BriefVid  4 месяца назад

      When we create the file `newfile.patch` it is UNTRACKED as it has never been `add`ed to the index. Thus, `git reset --hard` doesn't affect it.
      I hope this explanation is clear :)

    • @kthamim7552
      @kthamim7552 4 месяца назад

      @@BriefVid clear

  • @akashshelke8990
    @akashshelke8990 Год назад +1

    Very Informative Content. When are you going to upload 2nd part ?

    • @BriefVid
      @BriefVid  Год назад

      Thank you! I am working on it and hope to publish it in the next couple of weeks, it's now in the editing phase

  • @benzo_uncle
    @benzo_uncle Год назад +1

    Let's say I have added some object files (like .apk file) or created new directories into some commit. And then created a patch using git diff > oct_9.patch, Would it also contain the addition of new APKs into the patch. Do I need to manually put those APKs if I'm applying this patch??
    Thanks.

    • @BriefVid
      @BriefVid  Год назад

      Hey, I am not sure I understand your question. If your files are committed (they have been staged and actually included in this commit), applying the patch would introduce the new files.

  • @ashutosh108
    @ashutosh108 Год назад +1

    29:19 Why git apply -C3 new_patch.patch does not work here? We do have three lines of stable context
    So this is a file
    With more text
    It has some really nice lines
    before the added line "!!! This is the new line I am adding!!!".
    However, git apply -C3 --verbose says a strange thing:
    error: while searching for:
    So this is a file
    With more text
    It has some really nice lines
    Like this one
    And that one
    And we are now learning about Git
    So we are writing an example
    Git is lovely!
    however I do have all those lines as lines 2..9 of another_file.txt (line 1 being, like in your example, another added line)
    git apply -C2 works, but why git apply -C3 does not? Is it an off-by-one error in git?
    git version 2.40.1 here

    • @BriefVid
      @BriefVid  Год назад +1

      Great catch, it's an edge case and I should have used a more simple case to explain.
      The real issue here is that the very first line acts a bit differently. You can think of it as the line:
      "so this is a file"
      So it's considered a different context line as it's not the first any more.
      If you follow these steps again, but start from the second (rather than first) line of the file - it works with `-C3`.
      Sorry for not covering it in the video, and thanks for the question!

  • @mymacaintwag
    @mymacaintwag Год назад +1

    Could you do a video about merging and rebasing and what happened under the hood?

    • @BriefVid
      @BriefVid  Год назад

      @mymacaintwag sure thing - I am now in the editing phase of a video about merging. It will be followed by one about merge conflicts and another about rebasing. So, coming up soon :)

  • @agnaldopereiradasilva6007
    @agnaldopereiradasilva6007 7 месяцев назад

    Wonderfull! Thanks a lot!

    • @BriefVid
      @BriefVid  7 месяцев назад

      Thank you for your kind comment 🙏🏻

  • @debbietampasheher3682
    @debbietampasheher3682 Год назад +1

    I love your shirt 😂

    • @BriefVid
      @BriefVid  Год назад

      Thank you, I will try to put a new (funny) one every video from now on, stay tuned 😎

    • @debbietampasheher3682
      @debbietampasheher3682 Год назад +1

      @@BriefVid 😂

  • @allsunday1485
    @allsunday1485 Год назад +2

    Nice! Are you going to take a lot of time between videos in this series? I find that to be detrimental to the viewer's interest and the quality of delivery overall, and that'd be a shame for such great videos as yours. Always appreciate when content creators have a couple of videos ready and either post the entire playlist at once or follow a weekly or daily upload schedule.
    Just my two cents. Thanks for your videos!

    • @BriefVid
      @BriefVid  Год назад +1

      Thank you so much for your kind response!
      There is always a tradeoff between releasing every video once its ready and releasing all videos in a (mini) series one after another.
      I try to release every video once it's ready, especially as it takes so long to create this kind of videos. But I will do my best to get them out soon 🙏🏻

  • @amanobsa
    @amanobsa 7 месяцев назад

    how to solve this error patch -p0 < dir-antenna_ns235.patch
    can't find file to patch at input line 4
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |diff -Naur ns-2.35-orig/aodv/aodv.cc ns-2.35/aodv/aodv.cc
    |--- ns-2.35-orig/aodv/aodv.cc 2010-04-30 19:10:36.000000000 +0200
    |+++ ns-2.35/aodv/aodv.cc 2017-11-11 20:47:04.028090729 +0100
    --------------------------
    File to patch:

    • @BriefVid
      @BriefVid  7 месяцев назад

      I am sorry but I can't understand the input exactly. Is there a way for you to share a screenshot of what you tried to do?