Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Git 4b 🧩 Stashing Changes

Автор: TutsKGR Dev

Загружено: 2026-01-04

Просмотров: 0

Описание:

More Git Videos -    • Git  
#GitTutorial #VersionControl #GitCommands

Thanks for watching.
Any thoughts? Write a comment.
If you liked the video, Like and Subscribe.
It helps to create more videos!

4b Stashing Changes
Git stashing is a useful feature that allows you to temporarily save your uncommitted changes without making a commit. This is particularly helpful when you need to switch between different tasks or branches but don't want to commit incomplete work.

Basic Stash Commands
git stash
This command saves your current uncommitted changes (both staged and unstaged) and reverts your working directory to match the last commit.
git stash
git stash list
This shows all the stashed changes in your repository, displaying them in chronological order with descriptions.
git stash list

git stash pop
This applies the most recent stash and removes it from the stash list.
git stash pop

git stash apply
This applies a specific stash without removing it from the stash list, allowing you to apply the same stash multiple times.
git stash apply [stash-name]

git stash drop
This deletes a specific stash from your stash list.
git stash drop [stash-name]

Practical Examples
Let's walk through some common scenarios where stashing is useful:

Example 1: Switching Branches Temporarily
You're working on feature-branch but need to check something on main


$ git stash
Saved working directory and index state WIP on feature-branch: abc1234 Add login functionality

$ git checkout main
Switched to branch 'main'

$ git checkout -b hotfix/urgent-bug
Switched to a new branch 'hotfix/urgent-bug'
After fixing the urgent bug, switch back to feature-branch

$ git checkout feature-branch
Switched to branch 'feature-branch'

$ git stash pop
On branch feature-branch
Changes to be committed:

Changes not staged for commit:

Example 2: Managing Multiple Tasks
You're working on a feature but need to test something quickly

$ git stash
Saved working directory and index state WIP on develop: def5678 Implement user profile
Make quick changes for testing

Switch back to original work


Changes not staged for commit:

Example 3: Working with Multiple Stashes
Create first stash

$ git stash save "Working on login form"
Saved working directory and index state WIP on develop: def5678 Implement user profile
Make more changes and create second stash

$ git stash save "Fixing dashboard layout issues"
Saved working directory and index state WIP on develop: def5678 Implement user profile
View all stashes

$ git stash list
stash@{0}: On develop: Fixing dashboard layout issues
stash@{1}: On develop: Working on login form
Apply specific stash
$ git stash apply stash@{1}

Drop a specific stash

$ git stash drop stash@{0}
Dropped stash@{0} (34a2b5c...)
Advanced Stash Commands
git stash save [message]
You can add a descriptive message to your stash:
git stash save "Fixing authentication bug"
git stash show
This shows the changes in the most recent stash:
git stash show
git stash show -p
This shows the full patch of the most recent stash:
git stash show -p
git stash branch [branch-name]
This creates a new branch from a stash and applies it:
git stash branch new-feature-stash
Stash with Conflicts
When applying stashes, conflicts may occur if the files have been modified in both the stash and the current working directory:

$ git stash pop
Auto-merging src/dashboard.js
CONFLICT (content): Merge conflict in src/dashboard.js
The stash change could not be applied.
In this case, you'll need to resolve the conflicts manually, then stage and commit the resolved files.

Can you answer these Questions
What is the main purpose of git stash and when would you use it?
How does git stash pop differ from git stash apply in terms of stash management?
What happens to your stashed changes if you run git stash pop multiple times?
Can you have multiple stashes at the same time? How do you manage them?
What is the difference between git stash save and just git stash?
Why might you want to use git stash branch instead of git stash apply?
What are the potential risks of using stashing in a collaborative environment?
How can you see what changes are included in a specific stash without applying it?
What happens to your staged and unstaged changes when you run git stash?
Can you apply a stash to a different branch than where it was created?
What should you do if you encounter merge conflicts while using git stash pop?
How can you see the full patch content of your stashed changes?
What is the benefit of adding descriptive messages when saving stashes?
What happens to a stash when you successfully apply it with git stash pop?
Why would you use git stash show -p instead of just git stash show?

Git 4b 🧩 Stashing Changes

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Git 🧩 4f Forking and Pull Requests

Git 🧩 4f Forking and Pull Requests

Чем ОПАСЕН МАХ? Разбор приложения специалистом по кибер безопасности

Чем ОПАСЕН МАХ? Разбор приложения специалистом по кибер безопасности

⚡️ Заявление РФ о капитуляции Запада || Экстренная эвакуация войск

⚡️ Заявление РФ о капитуляции Запада || Экстренная эвакуация войск

РЫСЬ В ДЕЛЕ... Рысь против волка, койота, змеи, оленя!

РЫСЬ В ДЕЛЕ... Рысь против волка, койота, змеи, оленя!

Ночные пробуждения в 3–4 часа: как найти причину и вернуть глубокий сон.

Ночные пробуждения в 3–4 часа: как найти причину и вернуть глубокий сон.

Собаки Делают ЭТО, если Живут ПОЛНОЙ ЖИЗНЬЮ! (проверь свою)

Собаки Делают ЭТО, если Живут ПОЛНОЙ ЖИЗНЬЮ! (проверь свою)

25 Запрещенных Гаджетов, Которые Вы Можете Купить Онлайн

25 Запрещенных Гаджетов, Которые Вы Можете Купить Онлайн

Замерзли двери в машине, как открыть?

Замерзли двери в машине, как открыть?

Никогда* не используйте git pull

Никогда* не используйте git pull

Срочные переговоры с Путиным / Вывод части войск

Срочные переговоры с Путиным / Вывод части войск

HTML 4 💻 Form Elements 1 of 2

HTML 4 💻 Form Elements 1 of 2

Что наука знает об Иисусе, если он существовал?

Что наука знает об Иисусе, если он существовал?

Почему все ГЕРМЕТИЗИРУЮТ неправильно?

Почему все ГЕРМЕТИЗИРУЮТ неправильно?

Совет старика.

Совет старика.

Лучшая и самая неизвестная функция Git

Лучшая и самая неизвестная функция Git

Если у тебя спросили «Как твои дела?» — НЕ ГОВОРИ! Ты теряешь свою силу | Еврейская мудрость

Если у тебя спросили «Как твои дела?» — НЕ ГОВОРИ! Ты теряешь свою силу | Еврейская мудрость

Реальная Причина, почему Случайные Собаки Подходят к Вам на Улице!

Реальная Причина, почему Случайные Собаки Подходят к Вам на Улице!

Audi Quattro vs BMW xDrive vs Mercedes 4MATIC – Подробное сравнение систем полного привода

Audi Quattro vs BMW xDrive vs Mercedes 4MATIC – Подробное сравнение систем полного привода

Git 🧩 1a. Git Fundamentals Understanding Version Control

Git 🧩 1a. Git Fundamentals Understanding Version Control

Git 🧩 4c Cherry Picking

Git 🧩 4c Cherry Picking

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com