Git CLONE, PUSH & FETCH Tutorial

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

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

  • @Aramoonstaz
    @Aramoonstaz 10 месяцев назад +4

    Thank you for this video!!!! :D Currently trying to educate myself and git comfortable with learning Git for work. Twas very esthetically pleasing and straight to the point!

  • @dominiquekostler238
    @dominiquekostler238 3 месяца назад

    Something about how to fix diverged branches would be nice. Your videos are all enjoyable to watch, always come out knowing more than I did befor watching them!

  • @Sharon.Frenkel
    @Sharon.Frenkel 10 месяцев назад +4

    Hi, good stuff! I enjoy your other videos as well. Especially those about rebasing which really helped me. Thanks.
    I would definitely like to learn some more about the two topics you mention at the end of the video - diverging branches and setting up remote tracking branches manually. All the best.

    • @kobi219040
      @kobi219040 10 месяцев назад +1

      Same here! great videos man, really clear and helpful, thanks a lot!

    • @themoderncoder
      @themoderncoder  10 месяцев назад

      Appreciate it guys!

  • @iishanto
    @iishanto 6 месяцев назад +1

    Your approach of teaching git is awesome. I have cleared lots of my concept by watching your playlist.

  • @dayasagarpatil
    @dayasagarpatil 6 месяцев назад

    Excellent videos, have been using git but I had lot of confusion about many basic concepts, luck i came across your videos with very crisp explanation with awesome graphical representation which makes it very easy to understand. Keep up the good work, looking forward for more informative videos..

    • @themoderncoder
      @themoderncoder  6 месяцев назад

      Appreciate you saying that! If you're looking for something new, my video on fetching/pulling (ruclips.net/video/T13gDBXarj0/видео.html) is essentially a follow up to this one.

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

    Excellent video, thanks

  • @qwarlockz8017
    @qwarlockz8017 Месяц назад

    Great vid as always

  • @prashant6804
    @prashant6804 8 месяцев назад

    Thanks for explaining with graphics!

  • @MohammadLsk
    @MohammadLsk 10 месяцев назад

    Next level content🔥Keep it up

  • @matk2283
    @matk2283 9 месяцев назад

    all gold you are teaching here my dear friend. I can not thank you enough. your animation make all the difference in the world. my gratitude to you.
    Mathew. K from Colorado

  • @johncerpa3782
    @johncerpa3782 10 месяцев назад

    Excellent video

  • @bournvita382
    @bournvita382 10 месяцев назад

    Thanks. I really like your contents..

  • @lookingforbino
    @lookingforbino 8 месяцев назад

    Great tutorial. Thanks
    My question:
    Context: one of the weekends, I made tons of progress for the codebase, I changed 10 files. Let's say I am only allowed to make a PR that includes changes from 2 files. I don't want to make PRs during the weekends, and I am going to make 5 prs on Monday, and they all depend on each other, meaning I need to divide all my progress into at least 5 PRs.
    Question:
    What is your git stratagy to handle this situation?

    • @themoderncoder
      @themoderncoder  8 месяцев назад

      You'd probably need to do something like this (newsletter.pragmaticengineer.com/p/stacked-diffs); however, limiting PRs to only 2 files doesn't really make sense. If all the code changes are related to a single feature they shouldn't be split up. At the very least, I'd suggest grouping the files together based on functionality, but if one PR depends on another to function, they should probably be in the same PR.

  • @lookingforbino
    @lookingforbino 8 месяцев назад

    Thanks for the tutorial.
    A question: I ran into a problem of headless state after I checked out a specific commit inside the branch to make a pr on top of the specific commit.
    My manager told me don't checkout commit, alway checkout branch.
    I just don't understand this, what's the thing with headless state, and why it's a bad practice to checkout a commit?

    • @themoderncoder
      @themoderncoder  8 месяцев назад

      It's just that you'll have a harder time merging changes made in a headless state. Branches are really the core of Git, and a lot of mechanisms (merging, push, pull fetch, PRs) are based on branches/commits that build off of each-other in a predicable way. As soon as you check out a commit and enter a headless state, you're operating outside of a well established hierarchy of commits/branches. This means the changes you make can be easily lost, and it's harder to reconcile things afterwards. I'd view checking out a commit as a rare operation.
      If I understand your situation correctly: if you really need to make changes off of a specific commit maybe creating a new branch and cherry picking the commit into that branch might be easier.

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

    I am new with git could you explain me other video the differences between git pull and git fetch?

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

      I got you! Git PULL vs FETCH:
      ruclips.net/video/T13gDBXarj0/видео.html

  • @TheSpeechkiss
    @TheSpeechkiss 8 месяцев назад

    I'm a bit confused.
    In the first example, you did this:
    1. touch config.json
    2. git add .
    3 git commit -m "Added configuration file skeleton"
    4. git fetch origin
    5. git push origin main
    git fetch origin - "reaches out to remote repository and pulls down any new commits that you might not have yet" .
    However in the second example(coffee break) you did this :
    1. git fetch origin # automatically downloads the changes
    2. git status # your branch is 1 commit behind
    3. git merge origin/main # to incorporate those changes into your local branch - to merge your local main with origin main.
    4. git status # Voilà !
    I don't fully understand why did you do "git merge origin/main" in the 2nd example.
    In the first example just "git fetch origin" was enough to download any changes and then do a push.

    • @themoderncoder
      @themoderncoder  8 месяцев назад

      In the first example the origin repository doesn't have any new changes, so you could actually run "git merge origin/main" after "git fetch origin" in the first example, but nothing would happen.
      I was trying to keep the example as simple as possible which is why I skipped the merge in the first example; however, there is no harm in running merge after every fetch. If there is nothing, then the merge will just output "Already up to date."

  • @arithex
    @arithex 10 месяцев назад

    One problem with Git, for us newbs, is that the installer asks a lot of questions we can't possibly know the answer to -- like, whether git pull should always do fast-forward, or never, or merge etc.
    I'm far enough along to understand the installer is just trying to "help me" set some defaults in the gitconfig .. but I'm still not sure I know what the right answer to that is, for my workflow.

    • @themoderncoder
      @themoderncoder  10 месяцев назад

      Are you talking about the configuration options Git gives you the first time you run `git pull`?

    • @arithex
      @arithex 10 месяцев назад

      @themoderncoder No I mean literally the Git client installer .. on Windows, at least. As seen here ruclips.net/video/4xqVv2lTo40/видео.html
      It asks us several inscrutable questions.. which OpenSSL and SSH to use, which credential-manager to use, how to mangle our line-endings, etc. The barrier to entry for newbs (even experienced sw engineers) is quite high. There are some videos covering some of this .. but your videos are typically much better :) so if you're looking for content ideas, there's probably some inspiration-material there.

    • @themoderncoder
      @themoderncoder  10 месяцев назад

      @@arithex Ah I got you - thanks for linking that video.

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

    how is git fetch different from git pull ?

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

      Fetch simply downloads the changes but doesn’t merge them. Pull is a combination of fetch and merge under the hood, so it downloads AND merges at the same time.

  • @OpenDeepLearning
    @OpenDeepLearning 10 месяцев назад

    First

  • @vipinkoul595
    @vipinkoul595 10 месяцев назад

    I am not able to understand what "HEAD" is, for example, I see HEAD->main and like origin/main , origin/HEAD. Can anyone help me understand this

    • @themoderncoder
      @themoderncoder  10 месяцев назад

      HEAD is a pointer in our local repository used to indicate which branch is currently selected (i.e. checked-out). "HEAD > main" means that in our local repository the "main" branch is selected. "origin/HEAD" refers to the "HEAD" pointer in the "origin" repository. The syntax is slightly different but, "origin/main, origin/HEAD" in the logs is just indicating that the origin's HEAD pointer is referring to the main branch as well.

    • @vipinkoul595
      @vipinkoul595 10 месяцев назад

      @@themoderncoder Could you cover these fundamentals? It's very difficult to understand, please.

    • @themoderncoder
      @themoderncoder  10 месяцев назад

      @@vipinkoul595 I'm putting together a series of in-depth fundamentals videos for LearnGit.io that covers this and other fundamentals. RUclips isn't the best platform for slow, deliberate tutorial videos. I'm still working on it, but email me (jack@themoderncoder.com) and I'll send you a link to the video that covers branching and the HEAD commit.

    • @vipinkoul595
      @vipinkoul595 10 месяцев назад

      @@themoderncoder Thanks so much for the reply, grateful to you. I have sent you mail. BR

    • @themoderncoder
      @themoderncoder  10 месяцев назад

      @@vipinkoul595 Cool, responded and sent you a link to the vid.