How to finally Git Good

  Рет қаралды 74,353

Code Persist

Code Persist

Күн бұрын

Пікірлер
@AkaiKnight
@AkaiKnight Ай бұрын
0:21 Jesus Chris my heart actually skipped a beat hearing that chime 😂😂😂
@Ankit_0303
@Ankit_0303 Ай бұрын
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 Ай бұрын
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 Ай бұрын
​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
@aspiring_millionaire
@aspiring_millionaire Ай бұрын
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 Ай бұрын
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 Ай бұрын
better explanation than 99% 3-hour long git tutorials
@fozzzyyy
@fozzzyyy Ай бұрын
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
@jezusrvd
@jezusrvd Ай бұрын
As someone who is getting ready to apply to a job with no git experience, I’m glad I watched this. Thanks!
@TheDismalRabbit
@TheDismalRabbit Ай бұрын
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 👍🏼👍🏼👍🏼
@roguesecurity
@roguesecurity Ай бұрын
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.
@br3nto
@br3nto Ай бұрын
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 Ай бұрын
@@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 Ай бұрын
@@masterflitzer haha yeah I figured. Thanks for that, because i was able to improve my original comment.
@dreamsofcode
@dreamsofcode Ай бұрын
Great video!
@Hellbending
@Hellbending Ай бұрын
Dream coming in to #BoostTheBoy letsgooo
@codepersist
@codepersist Ай бұрын
Thank you, I love your videos!
@davidekWasTaken
@davidekWasTaken Ай бұрын
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.
@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!
@Dyils
@Dyils Ай бұрын
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 Ай бұрын
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 Ай бұрын
You just need to enable the “rerere” flag. Once you resolve a conflict - future rebases will reuse the same resolution
@mathewst3979
@mathewst3979 Ай бұрын
the ms teams ringtone is more triggering than my morning alarm
@miguel.bbeats4435
@miguel.bbeats4435 Ай бұрын
luv the video format!
@olatunjiolakunle6908
@olatunjiolakunle6908 Ай бұрын
That teams ringtone, I got one yesterday. 😂
@miguel.bbeats4435
@miguel.bbeats4435 Ай бұрын
I also suggest learning about working directory and local repository.
@mohamedkhalilkhamassi
@mohamedkhalilkhamassi Ай бұрын
0:21 I panicked, and put on my headset 😂😂
@donmyar
@donmyar Ай бұрын
I am watching nearly midnight and this woke me up
@valerianmp
@valerianmp 28 күн бұрын
I legit jumped upon hearing that bruh
@i_accept_all_cookies
@i_accept_all_cookies Ай бұрын
This was great! Would love to see a part 2, for using git in VS Code.
@bravo90_
@bravo90_ Ай бұрын
Git is a command line tool. It would be same as this video in vs code.
@b_dawg_17
@b_dawg_17 Ай бұрын
@@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 Ай бұрын
@@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 Ай бұрын
​@@i_accept_all_cookiesNot only could it, but there are in fact many such VS Code extensions that do just that
@raushankashyap7699
@raushankashyap7699 Ай бұрын
🔥 CSS Magic: Turn Basic Text & Emoji into a Masterpiece! #cssmagic #webdesign #webdevelopment kzbin.infoEao_bn95Z3Q?feature=share
@lassdasi
@lassdasi Ай бұрын
Add timestamps please
@sustrackpointus8613
@sustrackpointus8613 Ай бұрын
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 Ай бұрын
@@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! 👏👏👏
@jgav-b2z
@jgav-b2z Ай бұрын
Hey there, could you share your nvim config? looks amazing
@SHAMIKII
@SHAMIKII Ай бұрын
Can you please tell me which terminal you are using with, if any, theme or settings ?
@vladimir-ps3eo
@vladimir-ps3eo Ай бұрын
Really good tutorial!
@RoamingAdhocrat
@RoamingAdhocrat Ай бұрын
"after this video, rebase will be like any other git command" this does not fill me with hope
@hitarthpatel
@hitarthpatel Ай бұрын
Such a great video to the point no bs
@aravindmuthu5748
@aravindmuthu5748 Ай бұрын
Perfect, now teach us how to HEGALE!
@valerianmp
@valerianmp 28 күн бұрын
0:21 wtf man I immediately grab my phone
@Merlin-gl7zp
@Merlin-gl7zp Ай бұрын
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?
@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)
@michaelgraflmusic
@michaelgraflmusic Ай бұрын
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.
@poutineausyropderable7108
@poutineausyropderable7108 Ай бұрын
Huh? Fetch vs pull. please.
@danser_theplayer01
@danser_theplayer01 Ай бұрын
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.
@filippobuonco95
@filippobuonco95 Ай бұрын
What theme are you using for the terminal?
@AkaiKnight
@AkaiKnight Ай бұрын
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
@user-hl1hq4px2c
@user-hl1hq4px2c Ай бұрын
Great vid
@ZenityStudios
@ZenityStudios 22 күн бұрын
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.
@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 Ай бұрын
Which font is being used in the terminal emulator?
@trevorc5157
@trevorc5157 Ай бұрын
why not use git pull origin main on the feature branch before merging
@masterflitzer
@masterflitzer Ай бұрын
because you don't have linear history then, better do git pull --rebase origin main
@pabloqp7929
@pabloqp7929 Ай бұрын
yessir!!!
@keshavtha
@keshavtha Ай бұрын
this had pretty much all the basics covered.Great video .LIked and subscribed.
@razt3757
@razt3757 Ай бұрын
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
@monad_tcp
@monad_tcp Ай бұрын
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 Ай бұрын
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 Ай бұрын
Most likely zsh with powerlevel10k as a theme and autosuggestions (plugin)
@ЯрославСафонов-в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.
@thomasluk4319
@thomasluk4319 Ай бұрын
what kind of color theme is it?
@sriranga8951
@sriranga8951 Ай бұрын
What terminal application and shell prompt are you using?
@marcnassif2822
@marcnassif2822 Ай бұрын
Looks like zsh
@b_dawg_17
@b_dawg_17 Ай бұрын
Looks like the future
@coderbhai
@coderbhai Ай бұрын
what terminal theme is that?
@dedladxd4011
@dedladxd4011 Ай бұрын
which code editor do you use
@codepersist
@codepersist Ай бұрын
I usually use vscode, but what you saw in most of the video was neovim!
@hamzarashid7579
@hamzarashid7579 Ай бұрын
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 Ай бұрын
That's true! git switch is more recent, I am just accustomed to using checkout at this point 😅
@bopon4090
@bopon4090 Ай бұрын
Git checkout is still supported by the latest git and also it's not depreciated. So why not?
@hamzarashid7579
@hamzarashid7579 Ай бұрын
@@bopon4090 It's because git promise backwards compatibility. Try switching to a branch that doesn't exist using checkout.
@insu_na
@insu_na Ай бұрын
according to the git documentation `git switch` is considered experimental
@hamzarashid7579
@hamzarashid7579 Ай бұрын
@@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.
@ninetydirectory3798
@ninetydirectory3798 Ай бұрын
Too many o's in title. We only need one of them.
@Treviath
@Treviath Ай бұрын
This guide is already outdated. You should be using git switch instead of git checkout to prevent unwanted behavior
@br3nto
@br3nto Ай бұрын
When has git checkout ever given unwanted behaviour?
@Treviath
@Treviath Ай бұрын
@@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 Ай бұрын
@@Treviath I guess I’m exceptionally lucky. I’ve never run into that problem with git checkout.
@Treviath
@Treviath Ай бұрын
@@br3nto Neither have I. It's probably quite rare, but dangerous enough to warrant the split
@sirmewo5510
@sirmewo5510 23 күн бұрын
Video is too short
@Jabberwockybird
@Jabberwockybird Ай бұрын
Seeing git commits without a jira ticket # gives me anxiety 😆
@nothingtosee226
@nothingtosee226 Ай бұрын
Another Fireship clone?
@KimYoungUn69
@KimYoungUn69 Ай бұрын
Just add -force flag on every git command, problem solved
@marcola8776
@marcola8776 Ай бұрын
0:21 jesus this is not funny x(
@harry-smith404
@harry-smith404 Ай бұрын
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
@vasiovasio
@vasiovasio Ай бұрын
Bruh, invent Your style and stop using Fireship sh!t for the thumbnail! 😂😂😂
@Jabberwockybird
@Jabberwockybird Ай бұрын
Fireship doesn't have a style. It's just the default vscode look and feel
@goosybs
@goosybs Ай бұрын
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
@cirusMEDIA
@cirusMEDIA Ай бұрын
This video is useless! Thumbsdown!
@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
15 POWERFUL Python Libraries You Should Be Using
22:31
ArjanCodes
Рет қаралды 59 М.
The Value of Source Code
17:46
Philomatics
Рет қаралды 203 М.
Увеличили моцареллу для @Lorenzo.bagnati
00:48
Кушать Хочу
Рет қаралды 8 МЛН
МЕНЯ УКУСИЛ ПАУК #shorts
00:23
Паша Осадчий
Рет қаралды 5 МЛН
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 97 МЛН
Git MERGE vs REBASE: The Definitive Guide
9:39
The Modern Coder
Рет қаралды 128 М.
The intro to Docker I wish I had when I started
18:27
typecraft
Рет қаралды 264 М.
The Clever Way to Count Tanks - Numberphile
16:45
Numberphile
Рет қаралды 1,4 МЛН
How GitHub's Database Self-Destructed in 43 Seconds
12:04
Kevin Fang
Рет қаралды 1 МЛН
I never understood why you can't go faster than light - until now!
16:40
FloatHeadPhysics
Рет қаралды 4 МЛН
The Untold Story of VS Code
12:42
CodeSource
Рет қаралды 107 М.
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Рет қаралды 1,2 МЛН
How GIT works under the HOOD?
16:01
Tech With Nikola
Рет қаралды 206 М.
How 1 Software Engineer Outperforms 138 - Lichess Case Study
22:28
Tom Delalande
Рет қаралды 267 М.
Увеличили моцареллу для @Lorenzo.bagnati
00:48
Кушать Хочу
Рет қаралды 8 МЛН