Git Branches Tutorial

Branches are one of Git's most important concepts. And to master Git, it's essential to have a thorough understanding of how branches work. In this course, we'll look at the many actions you can perform around branches - from creating and deleting them all the way to publishing, renaming, and comparing them.
✏️ This course was created by Tobias Günther from Tower. Tower creates a powerful Git desktop GUI for Mac and Windows. You can download it here: www.git-tower.com
Note: This course focuses on using Git with the command line. You do NOT need Tower or any other GUI software to follow along.
⭐️ Course Contents ⭐️
⌨️ (00:00) Introduction
⌨️ (00:46) Hosted by Tower
⌨️ (01:27) Branches as a core concept in Git
⌨️ (01:51) Core concepts: the HEAD branch
⌨️ (02:25) Core concepts: local vs. remote branches
⌨️ (03:04) Creating new branches
⌨️ (05:21) Switching branches
⌨️ (07:26) Renaming branches
⌨️ (10:29) Publishing branches
⌨️ (12:10) Tracking branches
⌨️ (17:25) Pulling + pushing branches
⌨️ (20:22) Deleting branches
⌨️ (24:15) Merging branches
⌨️ (26:52) Rebasing branches
⌨️ (30:20) Comparing branches
⌨️ (32:30) Working with Branches Cheat Sheet: a handy resource for your daily work, free to download (www.bit.ly/git-branches-cheatsheet)
--
🎉 Thanks to our Champion and Sponsor supporters:
👾 Wong Voon jinq
👾 hexploitation
👾 Katia Moran
👾 BlckPhantom
👾 Nick Raker
👾 Otis Morgan
👾 DeezMaster
👾 Treehouse
--
Learn to code for free and get a developer job: www.freecodecamp.org
Read hundreds of articles on programming: freecodecamp.org/news

Пікірлер: 121

  • @eelbo
    @eelbo Жыл бұрын

    (30:20) Comparing branches Just a short note: if you use _three_ dots instead of two you'll see _all_ the differences in commits between branches, so not only commits that are in the second branch compared to the first but vice versa as well. Excellent intro to branches, very concise.

  • @aethelbread
    @aethelbread3 жыл бұрын

    I live for you Intro Guy. FCC you are my ROCK!

  • @carlosdm94
    @carlosdm943 жыл бұрын

    Needed a git tutorial so bad! Thank you for all your effort and helping the comunity! Great job :)

  • @salwabachraoui1730
    @salwabachraoui17303 жыл бұрын

    This channel is a life saver.

  • @the_randhir_singh9098

    @the_randhir_singh9098

    3 жыл бұрын

    Cool

  • @ritheshverma2332
    @ritheshverma23323 жыл бұрын

    Yours videos are really amazing and helpful. Huge respect

  • @sebiporini
    @sebiporini3 жыл бұрын

    Yes! I was waiting for this! Thanks! I am slowly falling in love with GIT

  • @user-ug2fw3wk3c
    @user-ug2fw3wk3c Жыл бұрын

    It is really easy to understand with clear and straightforward examples. Thanks for your great effort! 😁

  • @mattgraves3709
    @mattgraves37092 жыл бұрын

    Extremely practical. Thank you for making this.

  • @rafapioli75
    @rafapioli753 жыл бұрын

    Great explanation! It refreshs my memory like a breeze!

  • @paulaabad8329
    @paulaabad83292 жыл бұрын

    Thank 🤓💜, the integration of the branches was clearer, I had confusion with the commands. Excellent 👾

  • @dmitriilobanov3980
    @dmitriilobanov39803 жыл бұрын

    Very comprehensive guide. An excellent teacher

  • @burkhartwolff4429
    @burkhartwolff44292 жыл бұрын

    Great Tutorial - just the level of abstraction I needed on the subject. Very pedagigical explanations...

  • @RohitPatnaik7
    @RohitPatnaik73 жыл бұрын

    I must say you guys are amazing..... thank you ❤

  • @amyjackson1104
    @amyjackson11042 жыл бұрын

    God bless u! I was having so much trouble figuring things out without your video! Thanks so so much!

  • @therealfreezzz
    @therealfreezzz3 жыл бұрын

    Just awesome. Thank you so much!

  • @ossahmadrezaazimikohnabi5108
    @ossahmadrezaazimikohnabi51083 жыл бұрын

    I've learnt so much in this channel, I think I should tell my mother to bring you some goat milk :)) (we're nomads, it's costumery to give goats and goat products as gifts.)

  • @shauryakapoor2122

    @shauryakapoor2122

    3 жыл бұрын

    Nomads have phones/customer? Even access to internet. Could you please tell us more about your lifestyle, I'm curious.

  • @giorgioamato8176

    @giorgioamato8176

    3 жыл бұрын

    He is a modern nomad

  • @bengilman5188

    @bengilman5188

    3 жыл бұрын

    @@shauryakapoor2122 he’s gotta be trolling

  • @ossahmadrezaazimikohnabi5108

    @ossahmadrezaazimikohnabi5108

    3 жыл бұрын

    @@shauryakapoor2122 well I grew up in a city, so we do have net. But my parents where nomads for the first part of their life. Then my father went to school and became a health care worker, and was hired by the government, so technically we're not nomads any more, but my mother still does give people goat milk as a gift :))

  • @mosaed_b

    @mosaed_b

    2 жыл бұрын

    Because you are a descendent of a nomad family, you are a nomad (in culture) and this might not mean technically you are nomad. That is also me, although I lived my whole life in a city, and I had ps1, ps2, ps3, ps4, pc, I am a software development employee, and my parents have degrees, but my grand grandparents were nomad, because of the high poverty at that time, so they have traveled a lot, and suffered, and we took their culture and manners.

  • @WrestlingTournamentsDotCom
    @WrestlingTournamentsDotCom2 жыл бұрын

    This tutorial is very helpful!

  • @kostiantynkarzhanov9216
    @kostiantynkarzhanov9216 Жыл бұрын

    Thank you, very good tutorial! 💛

  • @ManojKumar-jb4sc
    @ManojKumar-jb4sc2 жыл бұрын

    Thankyou. It is such a helpfull tutorial to undestand git branches. Now also want to watch your git tutorial as well.

  • @threekingdoms99
    @threekingdoms993 жыл бұрын

    very useful, thank you!

  • @sherlockva
    @sherlockva Жыл бұрын

    Thanks! Very informative.

  • @matovumatthew1242
    @matovumatthew1242 Жыл бұрын

    Thanks very short and straight forward tutorial

  • @AlexBurov-wk8my
    @AlexBurov-wk8my9 ай бұрын

    this s extremely awesome video about branching god bless you Mr with clear voice and explanation

  • @chuck.dev007
    @chuck.dev007 Жыл бұрын

    Simple and concise.

  • @pulok9909
    @pulok99093 жыл бұрын

    Great tutorial.

  • @AmberRathour366
    @AmberRathour3662 жыл бұрын

    Thank you!

  • @hadouken99
    @hadouken996 ай бұрын

    Thank you for this good course

  • @Balkac
    @Balkac2 жыл бұрын

    Very cool explanation!

  • @7s9n
    @7s9n2 жыл бұрын

    Great tutorial 💛💛

  • @uc7602
    @uc76027 ай бұрын

    Thank you for this very informative video and I will start using git switch to switch between branches too 👍!

  • @MovvaTapaswipeace
    @MovvaTapaswipeace3 жыл бұрын

    ISTG, I was checking for it like yesterday!!!!!!

  • @JLDRPT
    @JLDRPT3 жыл бұрын

    4:59 - Sorry if I lost something, but you can create as many branches you want on your remote repository, like Github, Bitbucket, Gitea, etc.

  • @MrTomro

    @MrTomro

    2 жыл бұрын

    yeah you are right.

  • @user-ii4td6qt8d
    @user-ii4td6qt8d4 ай бұрын

    Use this command "because I'm more comfortable with it". Thanks for the explanation.

  • @Phas0ruk
    @Phas0ruk2 жыл бұрын

    Excellent tutorial

  • @soheilnazari6731
    @soheilnazari6731 Жыл бұрын

    Great Video, explained nicely

  • @viniciusm.m.7822
    @viniciusm.m.78222 жыл бұрын

    Thank you!!! God bless!

  • @teflonhav
    @teflonhav Жыл бұрын

    thank you!

  • @darkexior
    @darkexior2 жыл бұрын

    Amazing.. thank you so much

  • @johplaysmusic
    @johplaysmusic Жыл бұрын

    This man is Tech Curry

  • @webcodingoprogrammingtips2090
    @webcodingoprogrammingtips20903 жыл бұрын

    Great video

  • @louismarieatolukoayariga6052
    @louismarieatolukoayariga6052 Жыл бұрын

    Can there be conflicts when merging branches and how do we deal with the conflicts if they may come up?

  • @thecrownofnoah9100
    @thecrownofnoah91003 жыл бұрын

    Tip: if you go to a terminal or shell and type git help, it will show you git commands and what their functions are.

  • @okidokiyowyow356
    @okidokiyowyow3563 жыл бұрын

    Thanks.

  • @AleksandarIvanov69
    @AleksandarIvanov693 жыл бұрын

    'git push --delete origin feature/branch' is easier to remember, because the delete flag is of the push operation and then the location and object are given :)

  • @aljustiet

    @aljustiet

    Жыл бұрын

    I don't have it

  • @kayax01
    @kayax012 жыл бұрын

    Hi, I did some changes on a file locally (It's the only existing file...) but I didn't add it to the git project. Instead I created a new branch and made it active. Then I added the new modifications and commited them. I didn't push it yet to the remote repo. How can I access the unchanged (.pdf) file locally, say with adobe pdf-reader?

  • @kayax01
    @kayax012 жыл бұрын

    In the pdf file "working with branches in git" it says under publishing branches, that you can't create a branch remotely but instead you have to push the local one. So I did. But in github I couldn't see the new branch until I entered a name (the same one as locally) in a window called: "Find or create a branch". After that I could see the new branch also remotely. What is now correct?

  • @anarelle
    @anarelle2 жыл бұрын

    Great tutorial! Although I would've chosen different names for branches as it makes it confusing to follow up. If the command is called "branch" then I wouldn't name my branch "my-branch" as there are too many occurrences of "branch". Or "uploader" as the name of a branch to be uploaded causes you to say things like "I'll upload my uploader", which can be confusing for beginners. Other than that, great sound quality, great flow and great content.

  • @pjmclenon

    @pjmclenon

    Жыл бұрын

    the 1st command--git branch new-- doesnt even work

  • @Sa-jh5xc
    @Sa-jh5xc3 жыл бұрын

    Please add Polish subtitles in the future, I am learning English along with programming and I admit that sometimes I do not understand what is being said. I really don't know a more valuable channel. Congratulations for your work!

  • @jettthecoder1185
    @jettthecoder11853 жыл бұрын

    Heck ya

  • @lakshmimanne8796
    @lakshmimanne87962 жыл бұрын

    Mass git tower mass

  • @TheDareos93
    @TheDareos93 Жыл бұрын

    If i am in master branch and create a new branch the way it is described here, all the changes that i make on the new branch get automatically pushed to my master branch (and if i want to merge, git says my branch is already up to date). Can anybody explain?

  • @VskiDevs
    @VskiDevs2 жыл бұрын

    amazing stuff... but now how do I push a whole folder to a specific branch?

  • @esiarbaantwi7271
    @esiarbaantwi72713 жыл бұрын

    Thanks for the video. Please can you do tutorials on digital marketing.

  • @credoboyofficial
    @credoboyofficial3 жыл бұрын

    Oh git is so fun

  • @thevagabond85yt
    @thevagabond85yt9 ай бұрын

    never knew stephen curry so good at git

  • @md.iqbalmahamudmoon3012
    @md.iqbalmahamudmoon30126 ай бұрын

    does anyone have the slides used for this session?

  • @adeni4359
    @adeni43593 жыл бұрын

    I love the way he teach. Does he have other tutorial videos on Git?

  • @27sosite73

    @27sosite73

    Жыл бұрын

    google him

  • @bluemodize7718
    @bluemodize77183 жыл бұрын

    you are great i like you youtube channel

  • @StephenRayner
    @StephenRayner3 жыл бұрын

    Voting this one down for using tower

  • @sachinsudaraka6397
    @sachinsudaraka63973 жыл бұрын

    ❤️🤟

  • @jimshtepa5423
    @jimshtepa5423 Жыл бұрын

    at 15:04 is git branch --track an alternative to git clone?

  • @dtisue85
    @dtisue852 жыл бұрын

    For some reason I filled out the form 3 times over the last 3 months and can't seem to get the cheatsheet. Is there a way to just download it instead of having the download emailed?

  • @user-rf8qf9zi8i
    @user-rf8qf9zi8i5 ай бұрын

    How to update my git hub repository when i have downloaded a new npm package in my project.

  • @its_kumar
    @its_kumar3 жыл бұрын

    Any chance to use tower in linux ?

  • @ketchupparty9997
    @ketchupparty99973 жыл бұрын

    A course on Three.js please

  • @super7ace
    @super7ace Жыл бұрын

    Hello, Im not able to download the cheat sheet.

  • @techtravelspirituality3573
    @techtravelspirituality35733 жыл бұрын

    👍

  • @WorkHorse3002
    @WorkHorse30029 ай бұрын

    Continue from 17:24 Personal bookmark, please ignore

  • @VskiDevs
    @VskiDevs2 жыл бұрын

    wow

  • @anissiddique9137
    @anissiddique91373 жыл бұрын

    Sir plz make a video tutorial on Objective-C plz plz

  • @user-bk1le1nt5h
    @user-bk1le1nt5h11 ай бұрын

    voila :p

  • @karma_yogi_42
    @karma_yogi_423 жыл бұрын

    Bless you guys. How can I contribute? Im not a super knowledgeable dev but I can be handy

  • @sivuyilesifuba
    @sivuyilesifuba7 ай бұрын

  • @markosmuche4193
    @markosmuche41933 жыл бұрын

    what annoyed me is that, you were focusing on introducing the GUI thing. I gave it a thumbs up tho. good quality.

  • @devangprabhune3591
    @devangprabhune35913 жыл бұрын

    The intro guy so much looks like older gilfoyle

  • @StellarStoic
    @StellarStoic Жыл бұрын

    The course is great but never get to manage to get a cheatsheet. Too many clicks and always found myself in the loop. Never get the download link only email with Tower picture and confirm subscription. After confirmation it opens Tweet for the T-shirt and ....well the web is full of cheatsceats anyway so I stoped researching why is this happening. thanks tobias for explaining branches

  • @artificialcode
    @artificialcode Жыл бұрын

    His name's probably 47, Tobias reaper is just a stage name

  • @rabbanaabdilnakhairminqahr4648
    @rabbanaabdilnakhairminqahr4648 Жыл бұрын

    Ya rabb

  • @pjmclenon
    @pjmclenon Жыл бұрын

    i did git init and the your command doesn ot even work

  • @tarmon768
    @tarmon7683 жыл бұрын

    Maybe use Git locally so you stop training the Copilot

  • @shivjyotigarai2141
    @shivjyotigarai2141 Жыл бұрын

    8:50

  • @jyrj
    @jyrj3 жыл бұрын

    Cool😎 first comment

  • @trotin
    @trotin2 жыл бұрын

    Merci !

  • @sanchalghosh2110
    @sanchalghosh21103 жыл бұрын

    Tobias rieper

  • @jettthecoder1185
    @jettthecoder11853 жыл бұрын

    also FIRST!

  • @yoshimitsupunk
    @yoshimitsupunk2 жыл бұрын

    This video is a bit misleading. It only talks about the practical part of git branches. It didn't talk about what a git branch is and whether it's needed, when to use one, when not to use branches and the title didn't state whether it's for beginners or professionals. But I won't dislike it because it did at least explain how to create branches and work with them. You should change the video title to "How to work with git branches". I was looking for a more in-depth tutorial

  • @pjmclenon
    @pjmclenon Жыл бұрын

    hello why did you skip that we have to do git init 1st?

  • @pjmclenon

    @pjmclenon

    Жыл бұрын

    sorry but from expernice its best to never skip or assume previous steps preamble etc but whaterver

  • @nalo6310
    @nalo63103 жыл бұрын

    QQQQQ

  • @vpundir3024
    @vpundir30243 жыл бұрын

    Only coders are first viewers

  • @AhsankhanAmu
    @AhsankhanAmu3 жыл бұрын

    Thank you @freeCodeCamp for awesome tutorial.

  • @programming7685
    @programming76852 жыл бұрын

    Says you won't need tower for tutorial. Then immediately starts using tower.

  • @IfeSunmola

    @IfeSunmola

    2 жыл бұрын

    Right? I feel like half of the tutorial was in tower

  • @Caldaron
    @Caldaron2 жыл бұрын

    would be nice if the presentator doesn't use a product you'd have to pay for after 30 days. how f-ing ridiculous can one be...

  • @Nimitz_oceo
    @Nimitz_oceo3 жыл бұрын

    While I appreciate your dedication, however you have contradicted yourself. You said you will be doing everything from the cli but you constantly referred to your git UI instead of using the cli, NOT COOL

  • @HighRollersLounge

    @HighRollersLounge

    3 жыл бұрын

    Because this whole video is actually an elaborate advertisement of tool called Git Tower

  • @liam_iam

    @liam_iam

    3 жыл бұрын

    ye it's an ad. but he's still performing all the actions from the cli and using the gui as a visual guide, which I think is useful

  • @vajk7
    @vajk72 жыл бұрын

    Presentation was nice, kudos for that, but the ugly marketing gimmick with the "cheat sheet" leaves you with a bad taste after all ...

  • @louielee3583
    @louielee35833 жыл бұрын

    Link to the cheatsheet mentioned at 32:40 www.git-tower.com/learn/cheat-sheets/git-branches/

  • @pjmclenon
    @pjmclenon Жыл бұрын

    C:\Users\Main\Desktop eact\test_repo2>git init Initialized empty Git repository in C:/Users/Main/Desktop/react/test_repo2/.git/ C:\Users\Main\Desktop eact\test_repo2>git branch branch1 fatal: not a valid object name: 'master' C:\Users\Main\Desktop eact\test_repo2>

  • @richiemugambi9487
    @richiemugambi94873 жыл бұрын

    Freecodecamp is the best source of learning code fr fr

  • @fabrice9848
    @fabrice98485 ай бұрын

    Thank you!