RUVIDEO
Поделитесь видео 🙏

Creating & Checking Out Branches [Learn Git Video Course]

Learn how to create a branch in Git and how to make a branch active. This video is part of our free 24-part video course on Learning Git on the Command Line.
Subscribe ► https://www.youtube.com/channel/UCrl5xG-L4ZCFkR-bhUy9BVg?sub_confirmation=1

***************************************

Additional Git tutorials and resources

Learn Git on the Command Line: a free 24-part video course ► https://www.youtube.com/playlist?list=PLyCj4RCToz5DRDx3sJ4iW9i8D2G8OdHYH

Surviving with Git: https://www.youtube.com/playlist?list=PLyCj4RCToz5AKiAKycmAZcTZron_yANQT

More Productive in Git with Tower: https://www.youtube.com/playlist?list=PLyCj4RCToz5A_1RzK7MfNHSQr65FxmSGR

***************************************

Welcome to our video series on learning version control with Git. In this video you will learn all about creating and checking out branches in Git.

Let's say we want to start working on a new feature. Since new code always involves bugs, we don't want this to affect other topics or other people in our project. That's why we create a new branch.

Let's say we're working on the "signup" feature. "git branch" and the name of the new branch will create a new context for us.

Notice how quickly this happened. Even in large projects, this won't take any longer. Because unlike other systems, Git doesn't have to copy the project's files or anything like that. You don't have to think long if you should create a branch - it's cheap and easy in Git and comes with no hidden costs.

Let's look at what this command did. Type "git branch -v" to see all of our current local branches.

There are two items at the moment: "signup", which we just created, and "master".

master is the default branch that Git creates for us with a new repository. It's absolutely not a magical branch - you could delete or rename it like any other branch. However, almost all teams decide to keep this default branch in their project.

This master branch already being there means one thing: you're always working on a branch in Git.

The output here contains another interesting information: an asterisk signals the currently active branch. So we know that master is the current HEAD branch. As a sidenote: "git status" always informs you about this, too.

Now, to start working on our new feature, we first have to make our new branch active. Type "git checkout" and the name of our branch to make it the new HEAD branch.

From this point on, all the changes and all the commits that we make only happen in this branch. No other context is affected by the changes - and the mistakes - that we might make.

Let's make a quick, simple change to see this in practice. I just create a new, empty HTML file, add this to the staging area, and commit it to the repository.

If we now look at our commit history, we see this new commit. Also, that new file is here in our working copy. No surprise so far.

Now, let's switch back to our master branch with "git checkout master". If we look at the commit history, here, we see that this last commit is not present. It happened in a different context. Also, this new HTML file is not amongst our working copy files anymore.

This is to demonstrate that these contexts are really separate from each other.

Congratulations on creating and checking out your first branch. That's it for now - see you soon in our next video!

SUBSCRIBE to learn more about Git, Tower & how to become a better developer!
https://www.youtube.com/channel/UCrl5xG-L4ZCFkR-bhUy9BVg?sub_confirmation=1

For more free ebooks, cheat sheets, and video tutorials make sure to check out our FREE learning platform! https://www.git-tower.com/learn/

STAY UP-TO-DATE:
Tower: https://www.git-tower.com
Twitter: https://twitter.com/gittower
Facebook: https://www.facebook.com/gittower

#git #learngit #gittutorial

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Creating & Checking Out Branches [Learn Git Video Course]», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.