Git & GitHub Tutorial for Beginners #8 - Branches

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 พ.ย. 2024

ความคิดเห็น • 94

  • @erichepperlewp
    @erichepperlewp 2 ปีที่แล้ว +35

    4:00 - Create feature branch from master: git branch new-branch-name
    4:24 - To switch to a particular branch: git checkout branch-name
    4:35 - Which branch am I on? git branch -a
    6:30 - To delete a branch: Checkout any branch except the one you want to delete; git branch -D branch-name
    7:25 - How to create new branch and check it out at the same time: git checkout -b new-branch-name

  • @mustyfx244
    @mustyfx244 3 ปีที่แล้ว +2

    4 years later and this is still one of the best git tutorial on youtube

  • @bytecauldron
    @bytecauldron 7 ปีที่แล้ว +141

    This was incredibly clear and concise. Thank you for these.

    • @NetNinja
      @NetNinja  7 ปีที่แล้ว +12

      Thanks so much, really glad you liked :)

  • @LeetCodeSimplified
    @LeetCodeSimplified 3 ปีที่แล้ว +16

    *Cheatsheet for this video:*
    $ git branch my-awesome-branch # create a new branch
    $ git checkout my-awesome-branch # switch to a specific branch
    $ git branch -a # view all branches
    $ git branch -D my-awesome-branch # delete a branch even if it's not fully merged
    $ git branch -d my-awesome-branch # delete a branch but only if it's is fully merged
    $ git checkout -b my-awesome-branch # create a new branch and switch to it immediately

  • @Encursed
    @Encursed 5 ปีที่แล้ว +38

    Im new to Git and GitHub, so thanks for the clear and understandable explanation.

  • @paulhitchmough4440
    @paulhitchmough4440 5 ปีที่แล้ว +32

    *googles git branch tutorial*
    *realizes it's net ninja*
    *already knows he's gonna be learned hard and learned easy*
    Thank you for what you do, Shaun!

    • @allania7med113
      @allania7med113 5 ปีที่แล้ว +1

      googles git branch tutorial
      remember that net ninja may have a tutorial on this
      googles git branch tutorial net ninja
      already knows he's gonna be learned hard and learned easy

  • @John-ti6iv
    @John-ti6iv 3 ปีที่แล้ว +3

    Amazing tutorial and teaching style. You teach in a tempo that allows to just do the things you do while listening to you in the background even not watching.
    Will highly recommend

  • @t.j.5574
    @t.j.5574 19 วันที่ผ่านมา

    You're an excellent communicator! Happy I found your channel. Been subscribed since I started my coding journey.

    • @NetNinja
      @NetNinja  19 วันที่ผ่านมา

      Awesome! Thank you! :)

  • @md.mehrabhaque2223
    @md.mehrabhaque2223 4 ปีที่แล้ว +1

    Man your explanations are crystal clear and beginner friendly, greetings from Bangladesh.

  • @renanmendes35
    @renanmendes35 ปีที่แล้ว

    Incredibly straightforward and well-explained.

  • @NeelSandellISAWESOME
    @NeelSandellISAWESOME 4 ปีที่แล้ว +2

    Thank you so much! This really helped me visualize what was actually happening when a new branch was created.

  • @mostidum
    @mostidum 2 ปีที่แล้ว

    The brevity and clarity on this video is so appreciated! Thank you! You're a legend.

  • @latestdave
    @latestdave 3 ปีที่แล้ว

    Mate, I saw alot of tutorials about branches and yours is the best by far! Thanks to You, I finally understand what branches are about and I can use them as well.

  • @munch6814
    @munch6814 4 ปีที่แล้ว +2

    This guy is a god at teaching. Why don't they hire teachers like you in our colleges TT

  • @lifewithoutbigbrother355
    @lifewithoutbigbrother355 4 ปีที่แล้ว +1

    Man you make everything so simple bro. Really appreciate you making this. Best online by far.

  • @anjanamaria
    @anjanamaria 3 ปีที่แล้ว +5

    This was SO GOOD! Simple, concise & gives you the exact, practical info you're looking for! Perfection

  • @ansarqazi4377
    @ansarqazi4377 2 ปีที่แล้ว

    The Net Ninja is really an amazing guy!

  • @seegerp2000
    @seegerp2000 3 ปีที่แล้ว +1

    This is an excellent video on branching. Thanks for putting this together so well.

  • @Hacking-NASSA-with-HTML
    @Hacking-NASSA-with-HTML 2 ปีที่แล้ว +1

    Just a Git Ninja 😁 Awesome job, man!

  • @ayushiagarwal6996
    @ayushiagarwal6996 4 ปีที่แล้ว

    Wish I had watched this before. Git is indeed needed, I had a project wherein I would save all the code into another folder and then make changes in case the code dumped. But git makes it a lot more easier to revert your changes in a second

  • @anthonycalo4047
    @anthonycalo4047 2 ปีที่แล้ว

    Really good tutorial! I like that you kept open editor on the left

  • @amanbagrecha
    @amanbagrecha 3 ปีที่แล้ว +1

    Why would anyone dislike the video. The `branch` video on YT.

  • @varunupadhyay2488
    @varunupadhyay2488 10 หลายเดือนก่อน

    Crystal clear explanation sir

  • @kobedonis627
    @kobedonis627 3 ปีที่แล้ว +1

    good job sir because i survive 2nd yr college!

  • @join_devhub
    @join_devhub 2 ปีที่แล้ว

    writing git commit messages in present tense is a good habit

  • @ozzyfromspace
    @ozzyfromspace 3 ปีที่แล้ว +3

    At least on Mac, "git branch" without explicitly including the "-a" flag will still show you all the branches in your repository, as well as the branch that you're on currently on using the color and asterisk approach, as per this video :)

  • @robbydeleon4872
    @robbydeleon4872 3 ปีที่แล้ว

    You are so great. Hope you make a series on Git Flow as well.

  • @apoorvbedmutha457
    @apoorvbedmutha457 3 ปีที่แล้ว

    incredible tutorial, especially your examples make understanding easy

  • @Youngs1998
    @Youngs1998 3 ปีที่แล้ว

    Thank you so much, git was really annoying me and your lesson is perfect

  • @IdolisaRojas
    @IdolisaRojas 11 วันที่ผ่านมา

    excelent video mate, straight to the point 👍👍👍

    • @NetNinja
      @NetNinja  11 วันที่ผ่านมา

      Awesome :) thank you for watching and taking time out to comment!

  • @chaimabouchoucha1827
    @chaimabouchoucha1827 4 ปีที่แล้ว

    very well explained, the net ninja makes thinks look so easy. thank you so much

  • @alan6506305
    @alan6506305 6 ปีที่แล้ว

    the best git tutorial on youtube thanks

  • @wBacz
    @wBacz 7 ปีที่แล้ว +7

    Maaaan ya are great! Perfect work! Your lessons are so simple, thx.

  • @swornimrajdhakal1689
    @swornimrajdhakal1689 3 ปีที่แล้ว

    tutorial level : GOD

  • @frankdvorak3644
    @frankdvorak3644 6 ปีที่แล้ว

    Great tutorial, so clear and easy to follow, you should get paid for this, watching all of your stuff now. Thank you

  • @nabeelaron7527
    @nabeelaron7527 5 ปีที่แล้ว

    You are really good at this, keep up the good work, man.

  • @_isaac_muniz_
    @_isaac_muniz_ 3 ปีที่แล้ว

    Thanks, ninja, very good course :)

  • @danieljohns1318
    @danieljohns1318 7 ปีที่แล้ว +1

    To test out creating a branch, I actually did the opposite of you haha! I deleted a file in the branch, but left it in the master ;p

  • @code-with-vivek
    @code-with-vivek 3 ปีที่แล้ว

    Great tutorial Net Ninja...

  • @cyril_bleh
    @cyril_bleh 4 ปีที่แล้ว

    Thanks for putting it more clearly :)

  • @carloslemare6060
    @carloslemare6060 5 ปีที่แล้ว +3

    Every time your Windows sounds with a dialog, I think it's mine, and I have a Mac, and in Work I use Linux! 🤪

  • @amelia0018
    @amelia0018 6 หลายเดือนก่อน

    SO HELPFUL! Thank you.

    • @NetNinja
      @NetNinja  6 หลายเดือนก่อน

      Glad it was helpful! :) thanks

  • @ranchu7083
    @ranchu7083 4 ปีที่แล้ว

    Very clear, many thanks

  • @sleep-404
    @sleep-404 7 ปีที่แล้ว +4

    Love you Ninjaa!!

  • @bruceskellator
    @bruceskellator 5 ปีที่แล้ว +1

    Great tutorial! Really appreciate it!

  • @atineshs
    @atineshs 5 ปีที่แล้ว

    Thanks for making it so simple

  • @mauricioaguilera9422
    @mauricioaguilera9422 2 ปีที่แล้ว

    Thank you for the help!

    • @NetNinja
      @NetNinja  2 ปีที่แล้ว

      No problem Mauricio, thanks for watching!

  • @DongQian
    @DongQian 7 ปีที่แล้ว +2

    Thanks so much

  • @professeurish
    @professeurish 4 ปีที่แล้ว

    that's what I was looking for

  • @urdustoriespoetrycollectio976
    @urdustoriespoetrycollectio976 7 ปีที่แล้ว +2

    Waow Very Helpful.
    Thank you

  • @practicaltechie5390
    @practicaltechie5390 7 ปีที่แล้ว +2

    thanks

  • @stackdeveloper6614
    @stackdeveloper6614 5 ปีที่แล้ว +2

    When I checkout from a new branch to master, the files associated with the new branch are not automatically removing from the atom project folder at the left top side. Why??

  • @gamewatch9967
    @gamewatch9967 4 ปีที่แล้ว +1

    Here before github renames it's "master" branch

  • @vamsi1507
    @vamsi1507 7 ปีที่แล้ว

    Hi Shaun,
    Thanks for the excellent tutorials. Can you make a tutorial on Native Script also?
    Thanks

  • @nickfleming3719
    @nickfleming3719 3 ปีที่แล้ว

    Would it be appropriate to use branches to deploy slightly modified versions of the master branch to different servers? or is there a better strategy.
    For example you set up separate servers to host your app for 2 different clients, but one of the clients requires some customization to be made

  • @ahmedalhisaie7698
    @ahmedalhisaie7698 6 ปีที่แล้ว +2

    thanks very useful

  • @Anandkumar-jl6eb
    @Anandkumar-jl6eb 5 ปีที่แล้ว

    Great tutorial for git................... whether it will work for all extension files????

    • @shrach8
      @shrach8 4 ปีที่แล้ว

      N - word: nobutwhatareyoutryingtoask?

  • @KevinTempelx
    @KevinTempelx 4 ปีที่แล้ว

    Thank you!

  • @dropfiremusic4752
    @dropfiremusic4752 5 ปีที่แล้ว +1

    Tremendous!

  • @ne9835
    @ne9835 5 ปีที่แล้ว +1

    Thanks man!!!

  • @CastIronAbs
    @CastIronAbs 5 ปีที่แล้ว

    Hi Net Ninja. I love your tutorials, thank you for everything. I have a question. You first committed the changes in the js file to branch feature-b. You then checked out the master branch. While looking at the master branch, although the old js file itself was not visible, the code from the old js file remained in the tab in the editor. When you go to close it, it gives you a warning asking if you want to save it. Is this a feature of Atom or a bug? If it is a feature, how do you turn it off?

  • @FrankNiessenMetallurgy
    @FrankNiessenMetallurgy 7 หลายเดือนก่อน

    I like brunch!

  • @leodragonheart754
    @leodragonheart754 3 ปีที่แล้ว

    git branch is enough the -a isnt needed when using VSCode. Anyone know if there is any reason for using -a?

  • @marcosraul4132
    @marcosraul4132 4 ปีที่แล้ว +3

    "It's just a javascript feature." lol

  • @victoraderibigbe4107
    @victoraderibigbe4107 4 ปีที่แล้ว

    How do you undo a revert commit?, and a reset commit without the --hard flag.Thanks

    • @likkiii07
      @likkiii07 3 ปีที่แล้ว +1

      try reverting that revert commit again lol

    • @victoraderibigbe4107
      @victoraderibigbe4107 3 ปีที่แล้ว +1

      @@likkiii07 Asked that question when I started learning Django. It's beautiful for me to see how far I've come. Weird how I've not needed to revert a revert since I started using git seriously
      😅
      Thank you!

  • @davideugene7911
    @davideugene7911 6 ปีที่แล้ว +3

    Merci :)

  • @ammarhassan_
    @ammarhassan_ 5 ปีที่แล้ว

    Good but that windows sound made me nuts of why my pc is doing noise till I find it was yours.lol

  • @Luna-cq9ic
    @Luna-cq9ic 5 ปีที่แล้ว +1

    Fortnite Ninja POG

  • @iamse16
    @iamse16 4 ปีที่แล้ว

    i can't create branch from what you do in this video..
    git branch (branch_name) - after entering this code this message returns "fatal: Not a valid object name: 'master'."

  • @AntoinSts
    @AntoinSts 6 หลายเดือนก่อน

    thanks very much :)

    • @NetNinja
      @NetNinja  6 หลายเดือนก่อน +1

      You're welcome :)

  • @warronfrench8163
    @warronfrench8163 6 ปีที่แล้ว

    So, *git checkout -b feature-a* replaces
    *git branch feature-a*
    *git checkout feature-a*
    in a single command?

  • @mo.ali.
    @mo.ali. 7 ปีที่แล้ว

    keep it up

  • @xyzw0
    @xyzw0 4 ปีที่แล้ว

    cool!

  • @Richard-pp9jr
    @Richard-pp9jr 6 ปีที่แล้ว +3

    Sorry but this behaviour is not consist on Windows. When you switch back to master the file from the new branch is that there as an uncommitted change.
    and you can not move back to the new branch you just created because it is locked out. Until you commit the file that was just created.

  • @dever312
    @dever312 ปีที่แล้ว

    what is this theme

  • @MustafaBirsoz
    @MustafaBirsoz 4 ปีที่แล้ว +1

  • @zidrexandag06
    @zidrexandag06 3 ปีที่แล้ว

    whooo

  • @prafulrane9037
    @prafulrane9037 29 วันที่ผ่านมา +1

    anyone in 2024?

  • @MotleyMagee-o4s
    @MotleyMagee-o4s 2 หลายเดือนก่อน

    Miller Jeffrey Smith Lisa Hall James

  • @linkin543210
    @linkin543210 ปีที่แล้ว

    whooo