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

Using the Stash [Learn Git Video Course]

Learn how to use Git’s Stash and save changes temporarily - without committing them. 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/watch?v=M-O8ZNW9icQ&list=PLyCj4RCToz5DRDx3sJ4iW9i8D2G8OdHYH

Learn Git with Tower: https://www.youtube.com/playlist?list=PLyCj4RCToz5BEcpZgwLfAhzxVRlDY3z-O

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 how to save changes temporarily in Git - without committing them.

Saving changes temporarily - why is this useful? We often have to switch between different tasks - and often, this leaves us with half-done work. For example, imagine you're working on a feature when suddenly an urgent bug report comes in. You have all those modifications in your working copy. All this unfinished work that doesn't belong to the bugfix you're going to make.

Committing your unfinished work would be a poor choice. Commits are really made to wrap up something completed. It might be small - but it should really be finished, tested, and working.

Here's where Git's "Stash" feature comes in.

"git status" shows us that we're in the middle of working on something. We have some local modifications in our working copy.
Let's say that an urgent bug report comes in. We need to get a clean working copy to work on this new task. With "git stash", all of our current local changes are saved away temporarily - and we're left with a clean working copy.

You can think of Git's stash as some kind of clipboard. "git stash list" shows you a listing of all stashed states. With the plain "git stash" command that we just executed, we created this item here. This is where our local changes were just saved.

You can create as many Stashes as you want - you're not limited to storing only one set of changes. Also, a Stash is not bound to the branch where you created it: when you restore it, the changes will be applied to your current HEAD branch, whichever this may be.

Later, we can simply continue where we left off. Just type "git stash apply " and the name of the stash. This restores the saved changes in our working copy. Voila! Our saved local changes are back - and we're exactly where we left off.

It makes sense to clean up a bit with "git stash drop " and the name of the stash, we delete this particular Stash from the clipboard.

"git stash list" will now show an empty list.

A handy shortcut is "git stash pop": this applies and directly removes the most recent stash from the clipboard.

To finish off, let's talk about when to use the stash. The answer is easy: any time you need a clean working copy. For example, before you switch branches, before pulling changes from a remote, or before merging or rebasing branches.

Most importantly, you should keep in mind that stashing can never hurt: it's very quick and easy and has no side-effects or drawbacks.

SUBSCRIBE to learn more about Git, Tower, and 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
YouTube: https://www.youtube.com/channel/UCrl5xG-L4ZCFkR-bhUy9BVg?sub_confirmation=1
Twitter: https://twitter.com/gittower
Facebook: https://www.facebook.com/gittower

#git #learngit #gittutorial

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

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

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

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