Git branches tutorial. How to use Git branches.

Поделиться
HTML-код
  • Опубликовано: 30 сен 2024
  • What are Git branches and how to use them in your development workflow?
    Find out from this tutorial.
    In this Git branches tutorial you will learn:
    - what are Git branches
    - how to create a branch
    - how to merge Git branches
    - and much more.
    What else would like to learn about Git? Let me know in the comments.
    Related Branches Git Tutorial
    ihatetomatoes....
    Premium Online Courses for front end developers and designers.
    ihatetomatoes....

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

  • @guillaumenovel-t3444
    @guillaumenovel-t3444 3 года назад +3

    great tutorial, well done!
    If I may, I think you should teach the new dedicated "git switch" command to people rather than the multipurpose "git checkout".

  • @nasarazam
    @nasarazam 2 года назад

    How do you get that blue and green bands in the terminal session.

  • @irmdev595
    @irmdev595 2 года назад

    so you dont like ketchup? wth man!

  • @hamed4451
    @hamed4451 4 года назад +1

    hi there, why when u merge branch2 on branch 1, the file in branch 1 removed? if we want to keep the files in branch1 and add files in branch2 to branch1 how can we do?

    • @Ihatetomatoes
      @Ihatetomatoes  4 года назад

      Hey Hamed, if you merge his branch into yours and the file is delete in his, the file will be deleted from yours too.
      You can used git diff before the merge to see what changes will you be merging, stash the files you want to keep and then merge and apply the stash.
      Maybe clumsy but that could work.

  • @himanshuchhikara4918
    @himanshuchhikara4918 2 года назад

    can we delete the remote branch ?

  • @philofblood855
    @philofblood855 3 года назад

    extremely git video!

  • @gojamoja6719
    @gojamoja6719 3 года назад

    great

  • @ukaszdugozima816
    @ukaszdugozima816 2 года назад

    Hello! Great Video! Could you please tell me which extensions you use to have this colourful names in your terminal especially a green colour in master and a blue colour in the path ?

  • @nepaliguitar
    @nepaliguitar 3 года назад

    Thank you for the detailed explanation and easy tutorial to follow along. Learnt the concept easily

  • @rubenramirez1109
    @rubenramirez1109 2 года назад

    Thanks for the video, it really helped me out! 😄

  • @r-17x95
    @r-17x95 4 года назад

    easy to understand video. Thank you so much

  • @starman9000
    @starman9000 3 года назад

    I love the way you explain, easy to learn. thank you

  • @joeseabreeze
    @joeseabreeze 4 года назад

    You almost gave the example I was looking for at the end, but you didn't. ;) How do I checkout a remote branch that's off of master? Example, someone creates changes and pushes their branch and asks me to work on it with them. How do I get their branch and changes without writing over anything I have on my local system?

    • @Ihatetomatoes
      @Ihatetomatoes  4 года назад

      Hey Joe, I don't think you can have more than one currently checked out branch in the same directory. The only way would be to have two local folders and checkout different branches in them. Makes sense?

  • @hamed4451
    @hamed4451 4 года назад

    how can delete online (repo) branch from terminal ? i've tried "git branch -d origin fearute/task1" but didnt work

    • @Ihatetomatoes
      @Ihatetomatoes  4 года назад +2

      Hey Hamed thanks for the comment, try this:
      git push origin --delete fearute/task1
      I can cover that in my future videos. Anything else?

  • @evic262
    @evic262 4 года назад

    i am a tomato hater too

  • @jamesguo222
    @jamesguo222 4 года назад

    Once a coach, forever a coach. Welcome back. Love the git branching animations.

    • @Ihatetomatoes
      @Ihatetomatoes  4 года назад

      Hope you are doing well. Getting some burpees in your daily routine?

  • @keithcarter5547
    @keithcarter5547 3 года назад

    I have a scenario where a change was made to master prior to feature merge into master. When I attempt to checkout the feature, I get a warning indicating that a conflict was spotted between the file I changed in the master and the same file stored in the feature. I would like to place that change (or merge) I made in master into the feature branch. Any recommendations?

    • @Ihatetomatoes
      @Ihatetomatoes  3 года назад

      Merge master into your feature branch, resolve the conflict. Then merging fewture into master will happen without any conflicts.

    • @Ihatetomatoes
      @Ihatetomatoes  3 года назад

      1. git checkout feature-branch
      2. git merge master
      3. resolve conflict
      4. git add -a
      5. git commit -m "merged master to feature"
      6. done

  • @thpyazmass
    @thpyazmass 3 года назад

    Hey hello,
    I have query ...
    While doing branching :
    - I have few files existing on master branch
    - Now I am going to create new branch from master branch can I get files which are already having on master brach to newly created branch ???

    • @Ihatetomatoes
      @Ihatetomatoes  3 года назад

      Commit on the master branch before you make the new branch or merge master to your new branch to bring new changes in. Hope that helps.

    • @thpyazmass
      @thpyazmass 3 года назад

      @@Ihatetomatoes
      Ty buddy !
      I don't want any master branch data to newly created branch 😉..
      Anyway I got something
      ------
      When we are create branch, it will have all the changes which it had earlier
      Is above one correct ???

    • @Ihatetomatoes
      @Ihatetomatoes  3 года назад +1

      Yes, when you create a branch it will have all code that the original branch has.

    • @thpyazmass
      @thpyazmass 3 года назад

      @@Ihatetomatoes
      Ty ☺️

  • @djumeau
    @djumeau 4 года назад

    @Petr ... do you add a task-ID as a best practice ?

    • @Ihatetomatoes
      @Ihatetomatoes  4 года назад

      Hi David, if you are using Jira or any other task management software it is good to add the task number to the branch name.
      You can find it by searching for the task ID. Any other questions please ask.

    • @djumeau
      @djumeau 4 года назад

      @@Ihatetomatoes ah smart!

  • @Skrattoune
    @Skrattoune 2 года назад

    Something I'm having a hard time to understand: I'm working in parallel on several features (that I need to drop temporarily at some point for prioritization reasons). As this is work in progress (WIP), I am not ready to commit the WIP files yet. so the WIP files exist locally, but not centrally on github. Then when I move with vs-code to another branch, the uncommited files remain in the explorer view... even if they are not related to the selected feature branch . this is quite disturbing for me. Did I set-up something wrong? or what should be the best practice to use ?

  • @nesuleo1779
    @nesuleo1779 3 года назад

    Been looking around for a video where i can learn this logically and finally someone ended the suffer 😃. Thnx a lot man.