In this video we're going to learn all the good stuff we need to know when working with GIT, things that are really painful to deal with (at times), given the slow learning curve that git has.
Part 1 of this video can be found here: • GIT and GitHub Explained (Part 1)
Chapters:
00:00 - Intro
00:16 - Merging Strategies
10:50 - Handling Conflicts
14:43 - Rebase operation
17:00 - Rebase Interactive
21:51 - Delete a branch (locally and remotely)
23:23 - Explore older commits
24:16 - Working with git cherry-pick
We're going to start by exploring the way we merge branches in GIT and to understand the main difference between merge commits and squashing commits before merging. All the explanations are done in a hands-on way, using the repository we created in part 1 of this video, which contains a very simple spring-boot application that we constantly modify to understand the git workflows.
You're going to see a nice trick of re-applying the changes on a different branch, if you've done them on the wrong branch initially, by using git stash and git stash pop.
Managing conflicts is a very important skill that you need to master when working with GIT, and we're going to see how conflicts are created and how we can fix them, by simulating some changes done by other developers on the master branch.
We also dive into the concept of rebasing and the advantages it brings over the classical merge workflow. Basically, when we rebase a branch, we're re-applying the commits we have on our branch, on top of the latest master commits (or generically the base branch you used when creating your feature branch).
This is very useful because while you work on your feature-branch, other developers can merge their branches into the master branch, and you need to make sure your branch is still working on the latest master commit.
We then switch gears and explore the interactive rebase, which is a very powerful tool that we can use to do a lot of good (and bad) stuff, like modifying commit messages/descriptions, re-ordering commits, dropping (removing) commits, and a lot of other things. An interactive rebase is a way to modify the git history, which should be done carefully because you may affect the local history of other developers by rebasing a mainline branch (master/main). An interactive rebase should be done only on your feature branch, to arrange your commits and make sure they reflect the changes properly.
And finally we explore a number of very useful operations that you may need when working with git, like the way we can delete branches both locally and remotely, the way we can explore an older commit in our repository, and also the way you can pick an individual commit from a different branch, and apply it on your current branch (cherry-pick).
Смотрите видео GIT Explained Part 2 (merge, rebase, conflicts, tips & tricks) онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Visual Computer Science 28 Декабрь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 483 раз и оно понравилось 13 людям.