How to finally Git Good

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

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

  • @AkaiKnight
    @AkaiKnight Месяц назад +149

    0:21 Jesus Chris my heart actually skipped a beat hearing that chime 😂😂😂

    • @Ankit_0303
      @Ankit_0303 Месяц назад +3

      Seriously! I was watching this video on my phone at night, half past 12, and boom 💥 😅 😅 don't give us jump scares, man..

    • @Microphunktv-jb3kj
      @Microphunktv-jb3kj Месяц назад +1

      Torvalds isnt creator of Linux ,
      He made the kernel, not the OS.
      Its like saying Kellogs made corn.

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

      @@Microphunktv-jb3kjno, he did make linux. Its just at this point, everyone calls a linux distro “linux” because people dont want to say gnu/linux or [distroname] linux

    • @arcowo
      @arcowo Месяц назад +6

      ​Linux is the kernel. GNU/Linux is the operating system that uses the kernel named Linux.

    • @maksadnahibhoolna-wc2ef
      @maksadnahibhoolna-wc2ef Месяц назад

      lmao fr guy scared the fuck out of me

  • @fozzzyyy
    @fozzzyyy Месяц назад +2

    1:22 nitpick - `git add .` adds all files in `.` (the current directory). Adding "all the files" (in the repo) is done with `git add -A`, which is a meaningful distinction if you are in a subdirectory

  • @aspiring_millionaire
    @aspiring_millionaire Месяц назад +9

    This is by far the most crisp and to the point explanation for merge conflicts I have ever come across, it's really helpful, thanks

  • @esra_erimez
    @esra_erimez Месяц назад +19

    Okay, this video deserves a bookmark in my browser. Well done.

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

      cheat cheats are better for looking it up in the future, atlassian has a good one iirc

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

      watch it now

  • @ElTsakoss
    @ElTsakoss Месяц назад +2

    better explanation than 99% 3-hour long git tutorials

  • @roguesecurity
    @roguesecurity Месяц назад +1

    Liking the video even before starting because 0:04 is the message I got today and this video shows up in my feed the same day.

  • @TheDismalRabbit
    @TheDismalRabbit Месяц назад +1

    Man, I honestly tell you this is the best Git/Github video I've seen. Im pretty impressed how you manage to tell in an easy way and clearly so many topics in less than 10 mins. Kudos for you, bro 👍🏼👍🏼👍🏼

  • @jezusrvd
    @jezusrvd Месяц назад +2

    As someone who is getting ready to apply to a job with no git experience, I’m glad I watched this. Thanks!

  • @br3nto
    @br3nto Месяц назад +4

    It’s easier to think of rebase as “moving your commits to ”. Usually what we want is for our commits to just follow on from the HEAD of the develop branch or what ever branch we’ve branched. So we generally “move our commits onto the HEAD of develop”

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

      no you're already at the head of dev before you do git rebase main on the dev branch, rebase would just take all your commits up to the point where it diverged with main and stashed them, then it resets to the main branch and applies them back from stash

    • @br3nto
      @br3nto Месяц назад +3

      @@masterflitzer I’ve updated my comment because it isn’t specific to any branch. When I rebase, my thought process is…. I want to move the linear chain of commits representing the change I want to make onto some branch. I’ve always checkout out the feature branch. I’m usually branched from the develop branch, rather than the master branch (aka fit flow style), so I’ll run ‘git rebase develop’. I think of this command, as move all my commits from wherever they are on the develop branch to the HEAD of the develop branch.

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

      @@br3nto yeah moving onto is a good term and makes it easier to think about, i was just confused because you said develop branch as in the video the example was rebasing a feature branch on top of the main branch, but i understand what you mean now

    • @br3nto
      @br3nto Месяц назад +1

      @@masterflitzer haha yeah I figured. Thanks for that, because i was able to improve my original comment.

  • @davidekWasTaken
    @davidekWasTaken 28 дней назад

    Love the visuals you used on the video !

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

    Always a good time when you need to submit a PR based on multiple dependent PRs so you make a branch then merge the dependencies there then rebase your branch onto that branch, then once the dependencies are merged again rebase from your dependency branch back onto main.

  • @Dyils
    @Dyils Месяц назад +9

    Rebase is annoying when you sometimes have to resolve conflicts for old commits you've made as it applies your commits to head 1 by 1 in the same order you committed them. Which might mean you're resolving conflicts for old code which is getting removed in the next commit anyway... It's one of the reasons I don't like it. Unless maybe you squish your commits so you don't have to resolve conflicts for older commits. But then you're managing commits a bit too much. I'd rather three-way merge in those cases.

    • @Videofiziert
      @Videofiziert Месяц назад +2

      This is the worst thing for me about rebase, too. I once (in a larger team) had to reapply like 40 commits during a rebase. That took more than 2 hours to finish, where a merge would have probably been done in 20 mins. Not only do you have to choose which is the right code to merge on each step, you also basically have to remember in which order you did it! Very error-prone. Also in my opinion you get very little in return. A clean history without merge commits. But what for? How often do you even actually look at the entire git history? I think I never did. MAYBE in order to understand code better when you join a new project. Honestly the few times a month I have to work with the history, I don't even notice merge commits, I just sort of skip them. And I think if you need to look into your history often, then something else may be wrong. Also, isnt' it kind of the point to have the history shown? Explicit merge conflicts then are just markers that show what actually happened. AND you have to force push. My 2 cents

    • @squirrelzar
      @squirrelzar Месяц назад +1

      You just need to enable the “rerere” flag. Once you resolve a conflict - future rebases will reuse the same resolution

  • @dreamsofcode
    @dreamsofcode Месяц назад +17

    Great video!

    • @Hellbending
      @Hellbending Месяц назад +1

      Dream coming in to #BoostTheBoy letsgooo

    • @codepersist
      @codepersist  Месяц назад +4

      Thank you, I love your videos!

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

    This is exactly the video that I was looking for today and did not find but just noticed it was recommended to me somehow in my notifications!?
    Thanks subbed!

  • @mathewst3979
    @mathewst3979 Месяц назад +4

    the ms teams ringtone is more triggering than my morning alarm

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

    That teams ringtone, I got one yesterday. 😂

  • @miguel.bbeats4435
    @miguel.bbeats4435 Месяц назад

    luv the video format!

  • @miguel.bbeats4435
    @miguel.bbeats4435 Месяц назад

    I also suggest learning about working directory and local repository.

  • @mohamedkhalilkhamassi
    @mohamedkhalilkhamassi Месяц назад +1

    0:21 I panicked, and put on my headset 😂😂

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

      I am watching nearly midnight and this woke me up

    • @valerianmp
      @valerianmp 26 дней назад

      I legit jumped upon hearing that bruh

  • @i_accept_all_cookies
    @i_accept_all_cookies Месяц назад +15

    This was great! Would love to see a part 2, for using git in VS Code.

    • @bravo90_
      @bravo90_ Месяц назад +2

      Git is a command line tool. It would be same as this video in vs code.

    • @b_dawg_17
      @b_dawg_17 Месяц назад +2

      @@bravo90_ you’re right. But… what if we instead requested a video on some of the common GUIs and tools for git instead?

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

      @@b_dawg_17 i think this tutorial was comprehensive

    • @i_accept_all_cookies
      @i_accept_all_cookies Месяц назад +1

      @@bravo90_ I can never remember the git cli. And I keep wondering if a gui could provide the visualizations we saw in this video, to help understand branching, etc...

    • @richi1235
      @richi1235 Месяц назад +2

      ​@@i_accept_all_cookiesNot only could it, but there are in fact many such VS Code extensions that do just that

  • @lassdasi
    @lassdasi Месяц назад +28

    Add timestamps please

    • @sustrackpointus8613
      @sustrackpointus8613 Месяц назад +2

      Bro, its a 10min video

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

      Git gud

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

      he forgot to make commits ig

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

      @@sustrackpointus8613 That's long enough for timestamps imo.

    • @Ma1ne2
      @Ma1ne2 Месяц назад +1

      @@sustrackpointus8613 Yeah but it covers a lot of very basic commands, so it would be nice to jump past them more easily.

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

    I just want to let you know that I loved the video :)

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

    best Git tutorial! 👏👏👏

  • @SHAMIKII
    @SHAMIKII Месяц назад +2

    Can you please tell me which terminal you are using with, if any, theme or settings ?

  • @jgav-b2z
    @jgav-b2z Месяц назад +13

    Hey there, could you share your nvim config? looks amazing

  • @michaelgraflmusic
    @michaelgraflmusic Месяц назад +27

    I can't remember the last time I did a push before doing a fetch. I'm always amazed by the stubborness with which some (many!) full time developers refuse to learn the basics of git.

  • @danser_theplayer01
    @danser_theplayer01 Месяц назад +1

    So rebase is like a fast forward for the case when main branch changed before we decided to merge?
    P.s. nevermind it literally doesn't merge and you just slide it along to the newest state of main.

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

    I wonder how people handles whole codebase changes in just terminals.
    I prefer clicking on Plus Icon to stage then a button to commit.
    (Yes, Yes. I know. We don't get UI everywhere. I know)

  • @Merlin-gl7zp
    @Merlin-gl7zp Месяц назад +5

    Sometimes Im scared by failed merge and the worst thing that sometimes happens is that I push the `banana`. I use lazygit to resolve conflicts as my editor doesn't yet support git.

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

      i push the banana?

  • @vladimir-ps3eo
    @vladimir-ps3eo Месяц назад

    Really good tutorial!

  • @RoamingAdhocrat
    @RoamingAdhocrat Месяц назад +1

    "after this video, rebase will be like any other git command" this does not fill me with hope

  • @user-hl1hq4px2c
    @user-hl1hq4px2c Месяц назад

    Great vid

  • @valerianmp
    @valerianmp 26 дней назад

    0:21 wtf man I immediately grab my phone

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

    Such a great video to the point no bs

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

    🔥 CSS Magic: Turn Basic Text & Emoji into a Masterpiece! #cssmagic #webdesign #webdevelopment
    ruclips.net/user/shortsEao_bn95Z3Q?feature=share

  • @AkaiKnight
    @AkaiKnight Месяц назад +4

    Question: When to use git merge vs rebase? I can fetch updates from main, then merge main into my feature branch locally, then push that up right?

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

      I think merge integrates the changes from upstream and creates a new "merge" commit while rebase just rewrites the history putting your changes after what you fetched.

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

      Simple, never rebase anything.

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

      the best strategy is to target linear or semi-linear git history: always rebase feature branches, always merge into main branch (never rewrite history in main), preferably squash merge into main so reverts of PRs are easier
      if you don't rebase feature branches you can easily loose control over the history and merge conflicts are harder because you don't know what changes when
      if you neither squash merge nor rebase feature branches your git history in main will be chaos and not semi-linear anymore and that doesn't scale well e.g. when you are working in a team

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

      ​@@vasiliigulevich9202 there's a simple rule: squash merge into main, rebase everything else

  • @aravindmuthu5748
    @aravindmuthu5748 Месяц назад +2

    Perfect, now teach us how to HEGALE!

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

    What theme are you using for the terminal?

  • @last.journey
    @last.journey Месяц назад

    Couple of days i accidentally tried to push .env file with oauth api keys and i didn't know that this env wasn't in my gitignore so githup didn't accept the commits and i was freaking out not knowing what to do i didn't even read the error it was so long like a linux booting screen
    Being not able to push your finally it's working code is a terrifying experience especially if you spent couple of days on it and actually forgot what it does and how it works

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

    im basically sharing this with everyone I know.

  • @fly2k781
    @fly2k781 Месяц назад +1

    Which font is being used in the terminal emulator?

  • @ZenityStudios
    @ZenityStudios 20 дней назад

    im just trying to figure out how to remove a file i committed in a commit thats 7 commits back without changing any of the last 6 commits. i cant push bc that file is too large to push to github, i never meant to add it but i cant remove it no matter what i try.

  • @trevorc5157
    @trevorc5157 Месяц назад +1

    why not use git pull origin main on the feature branch before merging

    • @masterflitzer
      @masterflitzer Месяц назад +1

      because you don't have linear history then, better do git pull --rebase origin main

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

    this had pretty much all the basics covered.Great video .LIked and subscribed.

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

    yessir!!!

  • @razt3757
    @razt3757 Месяц назад +1

    You can also rebase using: `git checkout main && git pull . feature1 --rebase && git origin push`, which is way easier to to understand and figure out what's wrong when something goes wrong, imo.

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

      aren't you pushing to main then? this should always be blocked, only PR into main, atleast as soon as you're not working alone anymore
      also your command is wrong it's git push not git origin

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

    what kind of color theme is it?

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

    what terminal theme is that?

  • @hamzarashid7579
    @hamzarashid7579 Месяц назад +125

    You shouldn't be using git checkout for creating and switching between branches, there is a new command for this, which is git switch.

    • @codepersist
      @codepersist  Месяц назад +45

      That's true! git switch is more recent, I am just accustomed to using checkout at this point 😅

    • @bopon4090
      @bopon4090 Месяц назад +46

      Git checkout is still supported by the latest git and also it's not depreciated. So why not?

    • @hamzarashid7579
      @hamzarashid7579 Месяц назад +10

      @@bopon4090 It's because git promise backwards compatibility. Try switching to a branch that doesn't exist using checkout.

    • @insu_na
      @insu_na Месяц назад +26

      according to the git documentation `git switch` is considered experimental

    • @hamzarashid7579
      @hamzarashid7579 Месяц назад +4

      @@insu_na I'm using it for quite some time and never had any issues. I think it's experimental because of some advance features but if you just going to be switching and creating branches, it's perfectly fine.

  • @monad_tcp
    @monad_tcp Месяц назад +2

    rebase should be the default, you always want your changes on the top of upstream, you don't want to do merges ever

    • @masterflitzer
      @masterflitzer Месяц назад +1

      yeah i always do git config --global pull.rebase true
      rebase everything, except merge into main (preferably squash), cause you don't want to rewrite history in main ever

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

    What cli does you use bro ?

    • @1sam2fisher
      @1sam2fisher Месяц назад +1

      Most likely zsh with powerlevel10k as a theme and autosuggestions (plugin)

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

    What terminal application and shell prompt are you using?

  • @ЯрославСафонов-в6ъ
    @ЯрославСафонов-в6ъ Месяц назад

    Its not "How to finally Git Good", its "how to start with git". And im using it for while now, not good at it though. But i didnt find any info here that will fill my gaps.

  • @ninetydirectory3798
    @ninetydirectory3798 Месяц назад +1

    Too many o's in title. We only need one of them.

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

    which code editor do you use

    • @codepersist
      @codepersist  Месяц назад +1

      I usually use vscode, but what you saw in most of the video was neovim!

  • @Jabberwockybird
    @Jabberwockybird Месяц назад +3

    Seeing git commits without a jira ticket # gives me anxiety 😆

  • @sirmewo5510
    @sirmewo5510 21 день назад

    Video is too short

  • @Treviath
    @Treviath Месяц назад +9

    This guide is already outdated. You should be using git switch instead of git checkout to prevent unwanted behavior

    • @br3nto
      @br3nto Месяц назад +1

      When has git checkout ever given unwanted behaviour?

    • @Treviath
      @Treviath Месяц назад +4

      @@br3nto checkout can be used to restore files in the working tree. If your project contains a branch and a file of the same name, you can accidentally delete your progress. There is a reason why checkout was split into switch and restore commands.

    • @br3nto
      @br3nto Месяц назад +3

      @@Treviath I guess I’m exceptionally lucky. I’ve never run into that problem with git checkout.

    • @Treviath
      @Treviath Месяц назад +1

      @@br3nto Neither have I. It's probably quite rare, but dangerous enough to warrant the split

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

    Another Fireship clone?

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

    0:21 jesus this is not funny x(

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

    Just add -force flag on every git command, problem solved

  • @harry-smith404
    @harry-smith404 Месяц назад +1

    Is that a new wave of videos about git rebase? Who is the target audience, guys who never read docs on official git web site?

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

    merge should be forbidden

  • @cirusMEDIA
    @cirusMEDIA Месяц назад +1

    This video is useless! Thumbsdown!

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

    Bruh, invent Your style and stop using Fireship sh!t for the thumbnail! 😂😂😂

    • @Jabberwockybird
      @Jabberwockybird Месяц назад +1

      Fireship doesn't have a style. It's just the default vscode look and feel

    • @goosybs
      @goosybs Месяц назад +1

      thats not even close to fireships branding, different colors, different fonts, font stroke vs no-stroke, non monotone background, use of glow vs no glow.

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

      His style is so good.
      - Make shit content
      - Put shit memes
      End

  • @Johnny-above
    @Johnny-above Месяц назад

    I would like to reach you about a collab. What is the best way to reach you? Email?

  • @dr.angerous
    @dr.angerous Месяц назад

    Jezus fuckkkk just use git extensions