Lecture 6: Version Control (git) (2020)

preview_player
Показать описание

Help us caption & translate this video!

Рекомендации по теме
Комментарии
Автор

31:42 git add ., git commit -m <msg>, git log, git cat-file -p <8d-commit-hash/ branch-hash/ file-hash>
32:47 git commit -a, git add :/
35:23 git log --all --graph --decorate
36:12 git status (have staged or commited or not)
41:41 git-checkout -f <8d-commit-hash / 8d-branch-hash> (switch branch)
43:11 git diff hello.txt (show the changes in the file compared to the last commit)
43:28 git diff <8d-commit-hash> hello.txt (compared to the branch)
44:33 git diff HEAD hello.txt
46:22 git diff <8d-commit-hash) HEAD hello.txt (change from to)
50:06 git branch (print all the branches), git branch -vv (extra verbose)
50:17 git branch cat (create new branch that points to the HEAD you are currently looking), git checkout cat
53:56 git branch -b dog
52:53 git log --all --graph --decorate --oneline (more compact view)

56:27 git merge cat (can do cat dog)
58:51 git merge --abort
1:00:41 git add ., git merge --continue > git commit -m <msg> / git commit
59:37 HEAD points to last snapshot in master branch, >>>> dog points to the branch you're trying to merge.

1:04:17 git init --bare (initiatialize empty git repo in current dir),
1:04:20 git remote add <remote name> <remote repository URL>, git push <remote name> <local branch>: <remote branch>
1:07:54 git clone <url> <folder name>
1:10:33 git branch

1:18:12 git blame .config.yml (who edit the file on which commit message by who, when), git show <commit hash> (to get line changes like git diff)

1:19:22 git stash (changes saved somewhere), git stash pop (get saved back)

1:20:46 git bisect
1:21:48 git ignore (put file name or *.extension)

braveshine
Автор

This is by far the best video I've seen on git. There's so many terrible git videos on youtube 🤦🤦🤦

jh
Автор

This proves first "It's the teacher who teaches" and then "It's the student who learns ".
The way the video is articulated shows how much effort the faculty has put in. Kudos to the teacher and to all the students you finally understood GIT from its core.

harshteck
Автор

This is exactly the kind of lecture on Git that I was looking for. Too many of these "crash courses" just settle on teaching you the cmds and that's it. I think it's crucial to have an intuitive understanding of what's happening internally within git. The absolute best advice I could give someone trying to climb the otherwise steep initial learning curve, is to first fully comprehend the simple data/object model: how the repository tree is represented and versions of it are maintained; and the use of SHA-1 hashes to represent both file/object content, and most importantly how a hash (as a commit) handle uniquely defines a versioned state of the repo tree. I don't believe this point can be stressed enough: without an intuitive high-level understanding of what's going on internally, the task of learning GIT degenerates into a exercise of memorizing seemingly unrelated command invocations.

guccifer
Автор

Definitely one of the better introductions to git that I have seen. In one and a half hour, Anish succeeds in explaining the theoretical model behind git, and then goes from basic git usage over branching and merging to using remotes. And this all in 85 minutes. Well done!👍

BartVandewoestyne
Автор

These students actually ask questions I want to ask, it feels so good...

chilling
Автор

It was a unique lecture, you didn't just do commands like others but you explain the data model of git and things behind it.
Thank you for this really missing things.

waseemkntar
Автор

The video suggested on my YouTube and I wonder why but I ended up seeing it complete. First time I don't curse YouTube for random recommendations.

chaus
Автор

This is the best Git Tutorial I've ever seen. And I've been using Git for more than a year with very little confidence. This gives me immense confidence in handling all the changes that my team does.

VamsiMohanKrishnaVadrevu
Автор

Great lecture. The first 25 minutes is an excellent example of a systems design interview question :')

manarshawkey
Автор

11:08 I love how the arrows point in the correct way. Too many examples make the arrows point into the direction of the future. A new snapshot is based on an older one, thus the arrow should point towards the older snapshot!

DutchmanDavid
Автор

What are your favorite commands from this lecture? I found all the best stuff to be in the last 10 minutes. My favorites are:
*git add -p <file>* (interactively stage changed hunks of a file rather than the entire file)
*git show <hash>* (shows commit message and changes)
*git bisect* (binary search commit history to find where a bug or change happened)

Chiramisudo
Автор

Used git for years, interesting to learn about the data model and the pointers.

Kaltinril
Автор

At 13:35, it is said that the code of one branch could influence the behaviour of the code in another branch, and you wouldn't know before merging those branches. While this is very true, it is *not* necessarily a merge conflict. It could very well be fast-forwarded (ie. the 2 branches never changed the same line of code) and yet a new bug might occur. Only continuous automated tests can detect those defects, not merge conflicts.

docteurklein
Автор

This course needs to be in every university...

aavocadoToast
Автор

I just wanted to give a sincere thank you for uploading these lectures!

tjbruno
Автор

No Joke, this is the best GIT-Video I have ever seen.

sebastianbraun
Автор

This is the best video for git. Totally worth it. Whenever I have to recommend someone for git, I'll recommend this and say don't watch any video from YouTube until you finish this one

takshpatel
Автор

have checked 10+ git tutorial on YT and this is by far the best one with no doubt

seank
Автор

Here's my explanation of a hash function: You input some data and the output is a hexadecimal number. If you change the input a little bit, the output will look wildly different. You can use this to confirm you have an unchanged file from a website. If I have program P and I say the hash is X, you can download it, recreate the hash and if you *don't* get X, you'll know it's an edited file.
Well known algortihms are MD5 (outdated), SHA1 (outdated, though still often used), SHA-256 (current), though there are many more algorithms.
An input/output example for SHA-256 is:
input: Hello World!
output:
input: Hello, World!
output:
As you can see, the hashes differ wildly, even though I only added a comma to the text!

DutchmanDavid