100-Days-Of-DevOps-Challenge-KodeKloud

Git Stash

The Nautilus application development team was working on a git repository /usr/src/kodekloudrepos/ecommerce present on Storage server in Stratos DC. One of the developers stashed some in-progress changes in this repository, but now they want to restore some of the stashed changes. Find below more details to accomplish this task:

Steps

  1. Login into storage server and move into repository

     sudo -i
     cd /usr/src/kodekloudrepos/ecommerce
    
  2. Let’s check the stash list:

     git stash list
    
     [root@ststor01 ecommerce]# git stash list
     stash@{0}: WIP on master: 7fe985d initial commit
     stash@{1}: WIP on master: 7fe985d initial commit
    
  3. Restart stash files

     git stash apply stash@{1}
    
  4. Push changes

     git add .
     git commit -m "Restored stash files"
     git push
    

Good to Know?

Git Stash Purpose

Stash Operations

Stash Management

Advanced Stashing