When British folks type `git init` does the shell respond with "yes"?
@at0mly2 жыл бұрын
lolol
@rmsgrey2 жыл бұрын
Nah, mate. You need a double 'n' there, innit?
@blackenedsprite85422 жыл бұрын
In London yes, in any other part of the country it just initializes the repo.
@Knightfall232 жыл бұрын
😂😂😂😂
@nils-erikolsson35392 жыл бұрын
😂😂😂😂
@teppichboden22 жыл бұрын
It's unironically one of the best pieces of software out there. It's super useful, free and open source, and incredibly efficient.
@GrimmerPl2 жыл бұрын
And it all started with one guy being angry about software versioning option available at that time.
@pandaDotDragon2 жыл бұрын
and also super counter intuitive. A sh*t load of tutorials and still nobody understands how to use git with the command line (except the same 4/5 commands).
@morosis822 жыл бұрын
@@pandaDotDragon nonsense. I started with git in 2008/2009 I think, back then you had to really understand it to use it, but the modern changes to the command line make using it a lot easier. It's much more intuitive now, but you still need to understand what you're trying to do, and it provides access to the plumbing if you need it. Filter branch was a godsend when someone accidentally checked in an auth token or some giant binary blob.
@pandaDotDragon2 жыл бұрын
@@morosis82 Well I used to work with a committer to the git project and he was well aware of this issue so... That's why a lot of people preferred mercurial: the command line was easy to understand, easy to use.
@morosis822 жыл бұрын
@@pandaDotDragon I think it's a lot of just people are unfamiliar with using a command line on a daily basis in general. As someone who learned git early on, and has been a Linux daily driver for over a decade, mostly the GUI tools (apart from merge/diff tools) just get in my way. When you know what you want to do, cli is just better/faster.
@at0mly2 жыл бұрын
decent collaborative versioning systems have been one of the most important advances in software engineering. i say this as somebody that started programming over 20 years ago when we were literally emailing source files and tarballs around, before we got cvs (and then subversion and so on)
@johan.mp42 жыл бұрын
We had version control back then too, so no need to email files :)
@markostojanovic69732 жыл бұрын
@@johan.mp4 true, but accessibility of different servers and syncing was a pain. e-mail and sending diffs was often faster (but not reliable for the history)
@johan.mp42 жыл бұрын
@@markostojanovic6973 Git is for sure more convenient. But SourceSafe, which I used when I started out, worked pretty well too. I believe it was released in the early 90's. There are of course earlier systems than that. What I remember, was that branching was more complicated. But syncing worked well.
@at0mly2 жыл бұрын
maybe at large companies with the resources to run it and willing to pay for the software and the staff to administer it. even then it was generally one central server and terrible with any complicated branching.
@johan.mp42 жыл бұрын
@@at0mly we were a three people company. We realized pretty soon that we needed a VCS. Not only for collaboration, but also for backup of the code. I would probably have used it on my own as well.
@Android4802 жыл бұрын
I’m embarrassed to admit I’ve been using git professionally for years now, and really don’t know how it works internally. I have an idea about how it might track differences rather than just raw copies, but it’s magic to me.
@FabioRossettiFI2 жыл бұрын
it stores snapshots, not diffs - other source control softwares do, though
@p0n-pompf2 жыл бұрын
Isn't it like this with everything related to computers though? Even machine code is just a higher level language to the inner workings of a processor in a sense - as far as you know the input, you know the output it's everything that matters in the end
@tackline2 жыл бұрын
I still don't know the algorithm diff uses.
@menachemsalomon2 жыл бұрын
@@FabioRossettiFI I believe in the compressed (packed) form, Git does in fact store deltas, which are based on diffs. But they're on chunks rather than on files, and they can be reused, somehow.
@wizard73142 жыл бұрын
@@menachemsalomon if true, same thing that backup programs do, like duplicacy or restic.
@TheMilli2 жыл бұрын
I really would like a full video on how the .git folder actually keeps track of my version history. That would be incredibly interesting!
@shapelessed2 жыл бұрын
What would be incredibly interesting is an explanation on how thatovercomplicated, overengineered bloated software works.
@TheMilli2 жыл бұрын
@@shapelessed I mean, that is exactly what I'm asking for, isn't it? Also, since it sounds like you don't like git, what would you recommend instead and why? 😊
@maharjanlaxman2 жыл бұрын
True
@yondaime5002 жыл бұрын
There's a talk called "Rules to Git By" in the Coding Tech channel that does that.
@codycast2 жыл бұрын
There are 100s of KZbin videos on the topic.
@MrTridac2 жыл бұрын
I like the fact that Linus Torvalds developed git mostly out of spite. But now - like Linux in the world of OS's - it seems to take over the world of code management.
@lawrencedoliveiro91042 жыл бұрын
If there was any “spite”, it was not on his part, but on that of Larry McVoy in cancelling their BitKeeper licence.
@MrTridac2 жыл бұрын
@@lawrencedoliveiro9104 I don't know the exact backstory, but in an interview he basically said: "I was like f*&k BitKeeper it's s#!t anyway, I'll do it myself".
@lawrencedoliveiro91042 жыл бұрын
That was after the cancellation of the BitKeeper licence.
@elliott81752 жыл бұрын
@@MrTridac Sounds like Linus...
@BruceHoult2 жыл бұрын
@@lawrencedoliveiro9104 don't forget Tridge's part in it...
@Bob_Burton2 жыл бұрын
This would have been so much better with some demonstrations of Git in action
@blackenedsprite85422 жыл бұрын
Scott Hansleman has a fantastic video on git (possibly more than one 🤔). KZbin him :-)
@AndersJackson2 жыл бұрын
No, I really don't think that live demo would have helped. This is about actually understand what happen without using the tool. Would ACTUALLY helped if doing git with ordinary shell tools, not git. But that would probably been a bit to advanced for this channel And there are other videos that just do that. And they are great, if you already know about git.
@DaVince212 жыл бұрын
No, I think explaining the theory first and demonstrating it in a part 2 was the better idea.
@michaelcumming12332 жыл бұрын
Git is magic. I used to use it daily and forgot how it worked. Git, I think is one of the foundations of our technical culture. Isn't it surprising how so few people know about it and how, if you mention it to anyone at a party, their eyes glaze over immediately?
@badmanjones1792 жыл бұрын
>talking about git at a party yea why dont u bring up object oriented programming or maybe regex and see if that gets ppl more excited
@AndersJackson2 жыл бұрын
@@badmanjones179 yes, regexp are fun. I would love talking to some people about regexps and even grammars at a party. To few such parties though.
@lonelylongdistancekiller98442 жыл бұрын
@@AndersJackson hey that's how you get invited to parties ey? I'll stop talking about functions and boleans and start talking about git
@Kuchenklau2 жыл бұрын
I'm in my 5th semester of CS and while I've learned a whole lot about algorithms and Turing Machines, I'm an absolute git illiterate. So this video is much appreciated :D
@richardaversa71282 жыл бұрын
Illitergit
@stef90192 жыл бұрын
I was wondering if you guys have ever done a video on memoization, I think it'd be a great topic to cover for this channel, since you've already covered recursion, they go hand in hand.
@crazychicken03782 жыл бұрын
Tabulation would go hand in hand with their loops video as well
@AndersJackson2 жыл бұрын
I think they have done that.
@00ffdc2 жыл бұрын
Hey, nice electric upright bass at the background!
@Desolator-fz5em2 жыл бұрын
I remember back in my college days where I just make an archive of my source code for thesis (a record management system), and I name the archive like "rms-v1.0" and when I put some changes in source code i copy the archive again, put the changes and rename the newly updated archive into v1.1 or v2.0 whatever. Just a manual versioning of my source code back in the days. 😂
@IceMetalPunk2 жыл бұрын
I can't imagine doing my job without git (or, I suppose, some other versioning system). But I still remember the very first time I ever used it, back during a university group project. None of us had ever used git before, and while we were learning decently, we all panicked when there was a merge conflict *in a PNG file.* We didn't know about git reset, or git merge --abort, or even anything about what a merge marker was; all we knew was that we'd pulled some changes and suddenly our logo was completely corrupted and we didn't know why. That was a long night... To this day, I still think git needs better merge marking of non-text files...
@lawrencedoliveiro91042 жыл бұрын
How would you do it? With text files, you can narrow it down to lines which have changed, and show those lines to a human user. What would the equivalent be for binary files?
@KimYoungUn692 жыл бұрын
Lol how? U clearly do not knows how it works under the hood
@jonathonthomas30482 жыл бұрын
Git has no method of source control on non-text binary files. Changing one pixel on a PNG doesn't necessarily change only a single bit of data. Depending on what kind of compression is used and the file format used, two files with only miniscule differences between them could have drastically different binary data. Take into consideration not only PNGs, but JPEGs, GIFs, BIN files, compiled applications, ZIP files, etc. For git to be able to differentiate between two arbitrary binary files, it would need to know the format of that extension, how the data is arranged, any compression used, and more. This is way beyond the scope of what git is intended for, and all git can do with binary files is say, "hey, these are different" and leave it at that.
@IceMetalPunk2 жыл бұрын
@@jonathonthomas3048 No... that's not entirely true. There are many image manipulation libraries, for instance. If Git knows that PNG 1 and PNG 2 are different, it's not hard to create a third PNG that's a side-by-side comparison of them. It doesn't need to highlight the exact parts that are different, just offer the two versions next to each other so the user can crop the one they want and commit it. Git doesn't need to know which pixels changed, or do anything on a bitwise or bytewise level; it just needs to use a standard library to concatenate two images together. But either way, as I said before, even without all this fanciness, having Git output a report that says "hey, these are different" for non-text formats instead of injecting text-based conflict markers into a binary file (and thus corrupting it) would still be better than the current behavior.
@briancoverstone40422 жыл бұрын
The real power of git is where it figures out when and which files change (especially when there are hundreds of thousands of files), what the differences are between any two versions, merging with all kinds of different conflict resolve mechanisms... source code becomes moldable like clay, so much more than any other source code system that I've used.
@lawrencedoliveiro91042 жыл бұрын
Remember that Torvalds himself describes Git as the “stu
@lawrencedoliveiro91042 жыл бұрын
pid content tracker”. He deliberately avoided very elaborate conflict-merging schemes, preferring to concentrate on narrowing down the points of conflict so the human user has just the info they need to resolve the issue, without needless distractions. He said he wouldn’t trust his code to more complex automatic mechanisms that many others were proposing. Yes, “clay” is exactly the word that has come to my mind, too. Having all your work safely stored away in the commit history gives you the confidence to take more risks, knowing that, if you screw up, you can always go back. ;)
@paxdriver2 жыл бұрын
a live demo would've been peeeerfect in this video ;p thanks guys, love your work
@AndersJackson2 жыл бұрын
Really don't think that. Not to this channels audience. There are lot of videos where you can follow how they demonstrate git tools. It WOULD be useful if the management would been done by ordinary shell tools, only use git status and git log to verify the work. There are still such videos out there.
@paxdriver2 жыл бұрын
@@AndersJackson they do demos all the time on this channel. C, C++, Python, I've seen several low level code demos on this channel, a short 7 or 8 terminal commands wouldn't be out of the ordinary at all.
@jasonzvaniga2 жыл бұрын
I wish you would say `files` instead of `codes` .. Git is useful for any files/folder, not just for coders/codes.
@arngorf2 жыл бұрын
Except that binary files are not well supported, at least under basic git. Some other versioning systems, for instance, has support for displaying images, videos and 3D assets natively. I would love for git to improve for these kinds of use-cases.
@retropaganda84422 жыл бұрын
Some people even use it to store the evolution of french law, which incidentally, is also called "code" ;p
@wizard73142 жыл бұрын
That's not true. Git is really only useful for line-based files where the function mapping from semantics --> file content is continuous. I.e. small changes to the file give changes only in a few lines. It uses this feature of plaintext files (particularly code) to store diffs. Git is unusable for binary files or other files that don't satisfy these criteria. Every git commit you make stores the change to the files. So the changes better be small. With binaries, it nearly rewrites the entire file when you make a small change, at least from git's perspective. Especially if it is on one line, then it does entirely rewrite it. Now there are other software packages that even handle 'binary' diffs well. Backup software, like duplicacy or restic. There's also general compression algorithms for arbitrary files. A question I have is: is there a VCS that combines line-based and binary diffs?
@brucewayne24802 жыл бұрын
@@retropaganda8442 où est ce que je peux trouver ça 😛 ? C'est super intéressant
@retropaganda84422 жыл бұрын
@@wizard7314 AFAIR, in the most basic storage format, git doesn't store text diff, but an entire copy of the file. Last time I looked was probably git 0.x but I don't think the format ever changed since, except for Large-File-Storage. Now it also seems to sometimes consolidate files together into "packed refs" or something. Haven't had the curiosity to look into the details. It's probably pretty basic like the rest. In general, git becomes a problem with large repositories, and you have to fight the tool with the most obscure options to save disk space and network. Simplicity of the implementation comes with its costs. Unsurprisingly, it has far better performance on unices where you can work with medium-sized repos with no pain, but the performance on windows where the filesystem is slow makes it frustrating to develop on this platform.
@videopsybeam72202 жыл бұрын
I like to think of Git as an extremely high-level UNDO button.
@Slarti2 жыл бұрын
I'm 6:45 in and I haven't heard the word "repository"...
@alexesteh2 жыл бұрын
Someone said git is the only implementation of blockchain that works and isn't a scam
@drdca82632 жыл бұрын
That’s an overstatement. I think the better criticism of blockchain projects like bitcoin, ethereum, etc., is that their benefits aren’t worth the environmental costs (assuming PoW), and are also highly overstated, not that they “don’t work”.(“scam” is a kind of fuzzy word I suppose, but it also doesn’t seem quite appropriate to me.) The question of “are they actually used in ways that produce economic value?” both seems an interesting/important question, and also seems an ill-defined question. The only theory of economic value that has made much sense to me is the theory of subjective value, that economic value of something is determined by the value people assign to it, but, I do sometimes wonder if there is something which it is missing. But, what that something could be, I have difficulty describing to myself. It seems like some kinds of resources, are like, “actually useful” and “not something people are valuing for silly reasons”, but what does it mean for something to be “actually useful”? ‘ “Actually useful” *for what?* ’ I ask myself. The usefulness of a given resource seems like it would necessarily be in terms of what we would want to use it for? But, perhaps if we look at like, networks of what resources we can use to produce what other resources, and look at the inefficiencies of different cycles of conversions, there could be, like, some eigenvector decomposition junk, where looking at which eigenvalues (all less than 1) would be the largest, or something..? Like, suppose you could convert 1000 gallons of water and two cheese graters to 100 hamburgers and 2 cheese graters, and you could convert 100 hamburgers and 2 cheese graters to 900 gallons of water and 1 cheese grater, then, like, Well, going back and forth like that would convert 1000 gallons of water and 2 cheese graters into 900 gallons of water and 1 cheese grater. Erm... The idea I guess being that, perhaps we can separate the concepts of changes of who has which resources, from the concept of which resources exist, and then, well, we can’t make something out of nothing, so in some sense the amount of resources that exist and isn’t waste material should always be decreasing, but, if we neglect “the hydrogen the sun is burning” as a resource being used, and consider the light from the sun to be a continued source of resources from outside the system, and also I suppose we could consider resources extracted from the earth to be additions to the resources that are available, well, this still doesn’t seem to exactly account for “value”, but, if we looked at “what possible things could we do”, and like, only added a little bit of info about “what kinds of things do we care about whether we can do them?” maybe that could be a direction towards a more objective way to define “how wealthy are we as a society”? So, maybe using something like that as an additional extra thing to add on to the subjective theory of economic value? .... why did I start talking about the nature of value again? Something about cryptocurrencies? Ah, right. Yeah, like, when the prices go up, what does that mean? Well, it means that the price at which people are willing to buy and sell it goes up. And, if a person’s “material wealth” (I don’t mean this as a point against focusing on owning things. I’m just questioning what the best way is to evaluate “how much material wealth someone has”) is considered to be the dollar value of their possessions, or, how much other stuff they could buy at the current marginal prices, then this increase in price is an increase in their “material wealth”. But, what is this reflecting “in reality”? I suppose this ties into the question of “why do currencies have the value that they do?”. What is the “real meaning” of the exchange rate between Norwegian Kromer and the British pound changing over time? Like, yeah, at the basic level it means the amount of one you can exchange for the other is changing. But like, why? When it is changing, is the wealth of the person with money in the one currency increasing, or is the wealth of the person with the other currency decreasing? What’s going on? (In my town) All questions.
@barneylaurance18652 жыл бұрын
Git uses a merkle tree, but it isn't a blockchain because it doesn't have a consensus mechanism. If different people commit different things to their own copies of their project git leaves it up to each person to decide which commits to pull in and which to ignore. It works fine in a team where everyone works together and people can agree on what software they want to build, or in a open source project where the leaders manually pick and choose what contributes to accept and what to reject. A blockchain would have some automatic built in way to control who got to add commits and avoid creating multiple incompatible branches of the software, because it supposedly needs to solve the Byzantine Generals Problem,
@4_real_bruh2 жыл бұрын
You can also use git to automate backups if you're sick of services like Windows Backup by creating a local repo, it doesn't *just* work for code, even if that is it's main purpose
@phizc2 жыл бұрын
It's really inefficient for anything but text files though, storage wise.
@4_real_bruh2 жыл бұрын
@@phizc true, but it is useable
@AndersJackson2 жыл бұрын
@@phizc and lot of stuff is also just text files. This is why binary config files are the spawn of the devil
@GreatLakesDrifta2 жыл бұрын
GIT is terrific. A feature my team uses extensively is Pull Requests, great for quick code reviews. Also, git integration with IntelliJ/IDEA IDE tools is great for finding potential breaking changes when "nothing works anymore".
@anujkondhalkar97762 жыл бұрын
git branch -M main ? What is it new in github. -M and -M main. Please tell me.
@alice_in_wonderland422 жыл бұрын
@@anujkondhalkar9776 why tf r u spamming this same qs everywhere?
@anujkondhalkar97762 жыл бұрын
@@alice_in_wonderland42 , Because I had doubt ? So I send this question everywhere, So I can Get some help. I am new in git. Git just updated last year 2021 thats why.
@RubikMaster132 жыл бұрын
Pull requests?? How does that work? We use merge requests for code reviews.
@code123ns2 жыл бұрын
Pull requests are not a part of git
@jenna_tools2 жыл бұрын
I never realized how critical Git is until I was had to use it professionally. Now I'd never go without. Git it the ultimate undo button. It gives the freedom to experiment and break things with reckless abandon, always knowing that you have the git repo to fall back on if you brick the whole app. 10/10 would recommend.
@GytisValatka2 жыл бұрын
Man, I wish I had the same understanding of GIT so I would feel comfortable using it and exploring its potential.
@menachemsalomon2 жыл бұрын
Would you consider having someone on to explain the basics of how "diff" works? Considering that "diff" is pretty much the ancestor of every SCM system in play (back from the SCCS days and CVS days), I would be really interested in understanding how it works.
@oskrm2 жыл бұрын
diffinitely a good idea
@gloverelaxis2 жыл бұрын
really it's `diff` that's the secret sauce for all VCSes. without diffing and its inverse operation (patching?), they'd all be utterly useless: no automatic merging (thus no easy branching) and impractically large history files.
@dan-nutu2 жыл бұрын
Menachem Salomon: Three quick suggestions: 1. Wikipedia article. "The algorithm [...] became known as the Hunt-Szymanski algorithm". In a nutshell: "The operation of diff is based on solving the longest common subsequence problem" 2. man diff (the usual "read the fantastic manual") 3. source code Happy New Year all!
@menachemsalomon2 жыл бұрын
@@dan-nutu I've tried reading the wiki article. But I don't have the necessary mathematics and computer science background to understand it. Hence my asking for a video. As for the fine manual (that's the way I learned it), I don't recall either the man or the info page explaining how the algorithm works. The source code might be an option, if I got desperate.
@AndersJackson2 жыл бұрын
Actually, I recently discovered that git doesn't store any diff, like most other SCM systems. Git store all files that are current and in existence when you do a commit. Git never stores any diffs (conceptual). Files are compressed and then stored in git internals in full. And internals of git is really not that hard too understand.
2 жыл бұрын
Fun Fact: Linus Torvalds, the "inventor" of Linux also invented git.
@Michael_Smith_12 жыл бұрын
Me: I want a Mike Pound video Mom: we have Mike Pound videos at home. This: **Mike Pound video at home**
@RonJohn632 жыл бұрын
No mention of the phrase "version control", much less that it's *distributed* version control.
@kwanarchive2 жыл бұрын
He does mention version control. And it's pointless for an overview to talk about the differences between distributed and non-distributed.
@RonJohn632 жыл бұрын
@@kwanarchive I thought I paid attention to the video, but don't remember him saying that.
@kwanarchive2 жыл бұрын
@@RonJohn63 He literally says "version control" at 0:03 .
@AndersJackson2 жыл бұрын
@@kwanarchive and that is also correct. Git is a version controll system with support for being distributed.
@lawrencedoliveiro91042 жыл бұрын
9:20 Unlike Subversion, Git does not keep track of what you have checked out at the commit level, only at the branch level. To get around this, it can be helpful to use the “checkout -b” command to create a new, temporary branch pointing to the commit you just checked out. Since this branch is considered “fully merged” (the commit is part of the past history of some branch you really want to keep), you can delete it afterwards with “branch -d” (lowercase d, not uppercase D).
@joegee28152 жыл бұрын
We used to use SCCS back in the 1980s on Unix.
@AndersJackson2 жыл бұрын
Oh, I remember using SCCS too.
@kosnk2 жыл бұрын
I wonder if governments use some version control systems when they update the laws.
@calinguga2 жыл бұрын
i can tell you for sure some countries do not.
@oresteszoupanos2 жыл бұрын
The parallels between git timelines and films such as Back To The Future, Looper, Time Bandits, Primer etc. could be used to teach git to each film's fans :-) but it may be too niche as a teaching tool for Computerphile's broad audience...
@michaelcumming12332 жыл бұрын
I've often thought that too: wouldn't Git be useful for tasks and concepts way outside of software development?
@JosephDavies2 жыл бұрын
@@michaelcumming1233 Absolutely.
@AndersJackson2 жыл бұрын
Might you give us an synopsis of the manuscript of that?
@FFVison2 жыл бұрын
I remember using SVN many years ago for a web development firm, though I don't know all the details of how that worked for them, but was able to work it enough to do what I needed to do. I think they switched to git shortly before I left.
@AndersJackson2 жыл бұрын
Before git, svn was the best free software tool to find. Then came git. (The same way rcs replaced sccs, cvs replaced rcs, and svn replaced cvs)
@MrVipulLal2 жыл бұрын
Really basic stuff. There are thousands of videos at this level. Wish you would have gone deeper
@calinguga2 жыл бұрын
casually propping a stringed instrument just slightly out of frame, such a classic
@BrianWoodruff-Jr2 жыл бұрын
On the topic of rebase vs merge, I'm in camp rebase. I keep my feature branch up to date with the develop or master branch, taking care of any conflicts as needed. This keeps the master branch linear. There are no merge conflicts because those are taken care of during rebasing and the developer who wrote the code can take time making sure everything works before submitting a merge/pull request.
@lawrencedoliveiro91042 жыл бұрын
Rebase is OK for private branches. Once you publish a branch, rebase is going to cause those who pull that branch a lot of grief.
@pianochannel1002 жыл бұрын
This wasn't a very good explanation of git. Felt pretty disorganized, and for that reason failed to inform.
@bshulke2 жыл бұрын
Edit: NVM. It's an iOS feature to change the date to the day the iphone was originally announced when screen sharing. The iPad has a date of January 9th. Either they've been sitting in this video for almost a year before uploading, or are they're from the future.
@BAgodmode2 жыл бұрын
That thumbnail is perfect. Picture of a guy with GIT right next to his head.
@dcc11652 жыл бұрын
This is a VERY misleading video. You're implying files are "moved" from the main area, to the staging area, to the "git" area (via commit). Git doesn't do this at all...it only tracks file changes (diffs) of what's being managed. The only time Git actually copies code to the "git" or "staging" areas is on an initial add/commit. All other activity on these tracked files is stored as diffs between commits. Also, code protection is only a minor side-effect/benefit of Git. It's only a safeguard if you commit very very often. If you make a ton of changes between commits, rollbacks are horrendous because it may revert you "too far back". Git was originally designed by Linus Torvalds as an alternative to SVN/SCCS/RCS/etc to allow for "detached" collaboration of code. SVN/SCCS/RCS, etc. do not allow for simultaneous code changes. You have to "check out" whatever you're working on, which locks the code to read-only for other users. With Git, multiple people can be working on the same code file(s) by cloning the repo. Each of their changes will be merged without hassle...unless the same line of code is changed by two different people, at which time Git will alert you of a merge conflict. At that point, you have to contact the "other" author and agree on whose modifications are the best implementation.
@rezmed11442 жыл бұрын
The best GIT explanation
@lawrencedoliveiro91042 жыл бұрын
By the way, fun tip about the “du” command: if you type something like du -ks . that shows you how much disk space is being used by the current directory and its contents. Suppose it contains a .git subdirectory,
@lawrencedoliveiro91042 жыл бұрын
and you want to see how much space is being used just by the current source code, not including the version history. If you do du -ks .git . then it shows you the space used by the .git subdirectory, and then it _subtracts_ that from the usage it shows for the “.” directory. Because it knows the earlier directory is contained within the later one!
@jozefws2 жыл бұрын
best host of computerphile
@ReviveNRepair2 жыл бұрын
Great video! I think it would have been a bit easier to follow along if the example was demoed in the terminal instead of drawing :) And version control software should definitely be taught alongside every introductory course in programming.
@TJoseph22 жыл бұрын
Interested in that electric double bass in the background
@animarain2 жыл бұрын
Give us more Dr Max!
@IVAN_ENT2 жыл бұрын
Git add
@Danielagostinho212 жыл бұрын
What a coincidence. I just started using Git yesterday
@thargy2 жыл бұрын
Honestly, this was not a great explanation and there were quite a few (being generous) misleading (at best) statements. Not one of the better computerphile videos sadly, and I wouldn’t even recommend this as a basic introduction to git.
@thargy2 жыл бұрын
I really don’t want my comment to come across as too critical- however, YT does insist the comment section is the alternative to the downvote. There are genuinely misleading comments in this video and it should be avoided by anyone trying to understand git. For example, implying SVN (aka Subversion) and Git are fundamentally the same, is true at a very insubstantial level - but it would have been better to acknowledge that Git is a Distributed Version Control System, whereas SVN is fundamentally a VCS - and the distributed nature.of Git is fundamental. The video is riddled with these. It doesn’t really explain staging well. Labelling a branch based on the point of branching (e.g. “when it was working) as opposed to what is for (e.g. “fixing issue 18”) demonstrates a lack of real world experience. There are so many poorly-phrased claims that I really do think it should’ve been better proofed. Again, I really respect Computerphile, and this is the first video that I’ve felt compelled to warn others off.
@ryangrogan7832 жыл бұрын
My only gripes with git is that so many benign error crop up. I've had entire projects break or someone's branch for some reason doesn't ignore a file. Really frustrating when you can't push or pull because of some internal error somewhere that requires in depth console commands to fix. Not ideal when your team doesn't really understand the nuances or commands.
@c-LAW2 жыл бұрын
0:14 what is git for? It seems to be a great place for posting software license keys and many other hidden truths.
@123TeeMee2 жыл бұрын
So yeah, you need to stop thinking of "files", and more of "file changes". A bit like x versus dx in maths. A mistake I've made is changing and then staging a file, but then changing it again (before committing) and forgetting to stage it again, so I got strange errors due to the missing changes. In terms of software development in industry, git is essential. You should probably use a tool that gives you a graphical interface for git, like GitLens for VSCode, or GitKraken. Having the most common commands as buttons and being able to glance at a list of your changed files, whether they're staged or not, is very useful.
@AndersJackson2 жыл бұрын
Or use magit, which is great.
@bgezal2 жыл бұрын
I used CVS 20 years ago and the basics were the same. I think this wasn't as much of Git introduction as a versioning system introduction.
@lawrencedoliveiro91042 жыл бұрын
CVS tracked changes on a per-file basis. So if you refactored your code and moved a function from one file to another, that had to be recorded as two separate commits. The problem with this is that, in principle, you have a state of your repo in-between those two commits, where the code is in an inconsistent state. SVN improved on this by allowing the recording of changes to multiple files as a single commit.
@bgezal2 жыл бұрын
@@lawrencedoliveiro9104 I remember it being a pita to check in code and merge.
@peterisawesomeplease2 жыл бұрын
@@lawrencedoliveiro9104 The two key advances over SVN are that its distributed and its branch based. Although 90% of people don't use its distribution abilities. And honestly 50% of companies don't even meaningfully use its branch capabilities.
@parrotraiser65412 жыл бұрын
Programmers work with directories. "Folders" are for desktop users, spreadsheet jockeys, &c.
@barneylaurance18652 жыл бұрын
It's the same thing.
@parrotraiser65412 жыл бұрын
@@barneylaurance1865 Of course, which is why there's no need for a misleading metaphor,
@joshwilliams76922 жыл бұрын
Something I’ve found really helpful is permanently storing the undo history in vim. I often need to revert to previous versions of my file that I didn’t commit to git. If you enable the option, vim will track every single change you’ve ever made to your files. It’s incredibly helpful.
@V3racious32 жыл бұрын
Why show when you can tell... Excellent use of the medium.
@josephmcandrews90502 жыл бұрын
Doctor Wilson, I really like your shirt! Thank you for another great video.
@Lion_McLionhead2 жыл бұрын
Lions have been learning the quirks of git ever since it came out. Every startup has a different dance which exposes a different set of quirks, a new set of goofy finnish translations for words that svn, perforce & cvs used.
@michalbotor2 жыл бұрын
i believe that it is important to emphasize that git does not store **copies** of your files in different states - that would be wasteful and not much better than you doing it manually - what git stores are **differences** of your files in different states, and so what you see when you check out a commit is not the state of the commit but the stack of all commits up to that point.
@godarklight2 жыл бұрын
It might have been a bit clearer to actually show the git commands and the folder view rather than use the drawing pad
@emmanuelasika15902 жыл бұрын
About to go full-stack so this video came at the right time.
@morosis822 жыл бұрын
Git is useful whether you're full stack or not.
@emmanuelasika15902 жыл бұрын
@@morosis82 yeah... Just, I've mostly been doing WordPress related gigs. Now looking to go full-stack from polishing my frontend skills and then learning new backend tech. Git is a stable in this case
@sandyjonesmusic2 жыл бұрын
Nice overview, thanks dudes. BASS!
@ThatBeTheQuestion2 жыл бұрын
I really wish someone had taught me this when I was in school....
@TesterAnimal12 жыл бұрын
Git makes life *possible* for distributed teams.
@keescouprie59682 жыл бұрын
Why does nobody ask about the instrument in the background?
@amarissimus292 жыл бұрын
Even my computer fell asleep on this one. Cripes.
@stephane1842 жыл бұрын
Reading up on how blockchain works kinda reminded me how Git works as well with commit hashes and version history.
@AndersJackson2 жыл бұрын
@@__Brandon__ blockchains doesn't need to have prof of work, there are other ways of decide where the current top of the chain is in a secure way. Like a group if servers that you can ask and the majority will point ro the right node.
@knightcrusader2 жыл бұрын
Git is a great tool, and the way it structures data is brilliant. However, the command line interface is a goddamn mess. The commands are not intuitive at all, and I feel this is the biggest hurdle for getting people to understand it.
@user-hw3fz7ic5l2 жыл бұрын
نعم
@mptystring78922 жыл бұрын
I agree, command line interfaces scare people. It's sad when people stray towards graphical Git clients. For some, the GUI "training wheels" might never come off, limiting the ability to collaborate and use Git efficiently. Thankfully, work is being done to make Git's CLI more friendly. Some commands have been renamed so that they better describe their actions, instead of being named after similar commands in other version control systems. For an example, `git switch` is a new alias for `git checkout`. The command has always switched the working tree (the files in your git folder) to that of another commit. It has never "checked out" files, since there is no central repository server managing who has which files checked out (=locked for only them to edit).
@AndersJackson2 жыл бұрын
@@mptystring7892 never seen it as locking when checked out. Switch work too. My myself, I uses magit in emacs. Really powerfull git management tool.
@Nalojuntu2 жыл бұрын
Ok well... I'd really like to also see a video from you about how Git works from the inside, I mean the internals of it. : )
@whoareyouandwhatdoyouwant2 жыл бұрын
Where can I buy the "three part slogan" t-shirt? Made me laugh out loud haha
@Computerphile2 жыл бұрын
Search "Larry & Paul " ; ) -Sean
@chingfool-no-matter2 жыл бұрын
Thanks for the nice explainer video! would be great if we could also cover the conflict resolution algorithm in the next one.
@MichaelKingsfordGray2 жыл бұрын
How does GIT resolve: two simultaneous changes, from two different time-zones?
@barneylaurance18652 жыл бұрын
Git doesn't care much about time or time zones. It's interested in the order of things as recorded by one being based on another, not what time they happened. If two things happen in parallel it doesn't matter which one was first. Git will try and merge the changes together, if they conflict it will ask the person operating it to make up the synthesis of the versions that they want.
@ericmarcelino43812 жыл бұрын
I'm proud to say that I understand everything in this video!
@Wawet762 жыл бұрын
The story behind git creation is one that desearve to be told on this channel.
@apid40752 жыл бұрын
Git is simple and easy to use. If I didn't already, I wouldn't know what git is after watching this confusing video. I recommend looking up a better explanation.
@discretelycontinuous20592 жыл бұрын
This channel isn't really educational as such, rather entertainment / somewhat-informative
@insu_na2 жыл бұрын
Don't forget the glorious `git rebase` all hail the `git rebase`
@NnO0Worries2 жыл бұрын
What's up with the giant music instrument in the corner?
@markostojanovic69732 жыл бұрын
great topic, such a pity this was a pretty bad presentation (if i didnt know what he was talking about i prob would only get scared of using git). but on the other hand its impossible to explain git in 15 mins
@JeanNoelAvila2 жыл бұрын
Quite frankly, moving file pictures around does not give an accurate explanation, and is even misleading.
@peterisawesomeplease2 жыл бұрын
Yea it is super difficult to describe and 50% of organizations honestly don't use any aspect of git that svn was not capable of.
@hashomi05962 жыл бұрын
Great video. Git for me is a tool to go crazy and break stuff then revert.
@RandomNullpointer2 жыл бұрын
Can I use git with Libre Office documents?
@thadtheman37512 жыл бұрын
SAdly, his log looks like the logs of of VC atcompinies I worked at.
@aryanilpanja98468 ай бұрын
he really explained git well!!
@code123ns2 жыл бұрын
Once you get proficient with git, once you really understand how the internal data model works and how the commands manipulate it, you will be able to solve almost half the problems that git creates, without any trouble. Also, never forget that git has two kinds of commands: plumbing and porcelain and that neither is targeted for end users.
@AndersJackson2 жыл бұрын
Well, the only problem is to locate which command and sub command with what arguments that you should use. 🙂
@noswonky2 жыл бұрын
I've been using git for a few years amd before that Mecurial, SVN, CVS, RCS, ClearCase, Perforce, and SCCS, but this video just confused me.
@sageinit2 жыл бұрын
Next, do pijul, and how it (and it's spiritual PREdecessor, dArcs) differs tremendously from git
@AndersJackson2 жыл бұрын
Why? The presentation and explanation of git is in no way even finished on basic level.
@oldcowbb2 жыл бұрын
git gud
@willemvergouwen2 жыл бұрын
at git
@drdca82632 жыл бұрын
'gud' is not a git command. See 'git --help'
@hectortorres65672 жыл бұрын
This was really informative thank you
@thecaveofthedead2 жыл бұрын
Speaking of collaborations, when is a musical one going to happen between your presenters?
@felicianomazoio8012 Жыл бұрын
I want to be smart like you guys! 🥺
@refactorear2 жыл бұрын
2:28 Yep, but thanks to TDD now I know exactly when it breaks :)
@anttikalpio45772 жыл бұрын
I came here thinking you’d explain differencies between subversion, git and if there are any other comparable options. Please! Why git and not svn?
@AndersJackson2 жыл бұрын
For one, svn need internet access to work against the repository. In git your machine has your repository, so you have all history with you. So you can work on an airplain without internet access. Git can work in many different way, when it comes where repositories are stored. So it is much more flexible. You can for instance sync against many different repositories. Svn have problems manage directories, which git doesn't have. So yes, svn is basically only usable for history reasons. Anything svn can do, git can do. And probably better. That is not the case in the other direction. Yes, I have worked with RCS, CVS, svn and git. And that is my experiance. And each software is superior to the previous.
@abhirishi62002 жыл бұрын
Cool video!
@veenified2 жыл бұрын
Dive deeper into the technical details oh how git works.
@PushyPawn2 жыл бұрын
Oi! Who you calling a Git mate? Blimey!
@petterjunni2 жыл бұрын
Fun fact: both git and the Oura ring that Max is wearing are made by Finns.
@barneylaurance18652 жыл бұрын
Git was started by Finn, but the current maintainer is Japanese. And of course hundreds or thousands of people from many countries have contributed to it.
@marcogobbi02 жыл бұрын
great overview of how git works. thanks a lot. Can git be used, somehow, to create a collaborative application? i mean... imagine a web app where multiple users can edit the same data at the same time. just a crazy idea that come out of my mind :D... git proved to be a great tool for developers team work, so why not applying the same concept to an application that implies business guys working on the same data
@Daviid_52 жыл бұрын
Never thought about it, can you have git without a remote repository? As in 'git init' and then only using 'git add', 'git commit' and the like? Without git push? For some reason I've always created a "remote" repository in a different folder to "backup" my projects (same hdd, really)
@glasket_2 жыл бұрын
Yeah, that's viable. You don't need a remote; all repos are fundamentally the same, so your instance of having your remote in a different directory on the same machine is effectively just saving the same info twice for no gain. The only real situation that you would *need* a remote for is having a canonical source to share code from (technically possible on your own machine, practically a *horrible* idea though).
@barneylaurance18652 жыл бұрын
Absolutely. If you just need a backup that doesn't have to be a remote git repository. You can just use a regular file backup system.
@PauloConstantino1672 жыл бұрын
lol presenting git commands orally. i guess I should emulate a cpu in my brain to learn git then
@dankrukov18902 жыл бұрын
engineering masterpiece one yet to find anything nearly as unbelievably perfect (may be linux kernel)
@AndersJackson2 жыл бұрын
Unification algorithm and resolution algorithm behind the Prolog language might apply for that.
@bassett_green2 жыл бұрын
I want to know about that hotel desk bell on the sill behind him
@rylaczero37402 жыл бұрын
Also make a video on Mercurial and how its being adopted at bigger companies.
@lawrencedoliveiro91042 жыл бұрын
If they were using Microsoft Team Foundation Server, you can understand why _anything_ would be seen as an improvement on that ...