Git Stash

Tasks

  1. Go to the Git repository located at /usr/src/kodekloudrepos/blog on the Storage server.

  2. Identify available stashes.

  3. Apply the stashed changes with the identifier stash@{1}.

  4. Commit the restored changes with an appropriate message.

  5. Push the changes to the origin remote.

Steps

1

SSH to storage server and switch to root if needed

ssh natasha@ststor01
sudo su -
2
cd /usr/src/kodekloudrepos/blog
3

Confirm stash@{1} exists

git stash list
4

Restore the stashed changes

git stash apply stash@{1}
5

Confirm restored files are ready for commit

git status
6

Git add and commit

git add .
git commit -m "Restore changes from stash@{1}"
7

Push to remote

git push origin master

Last updated