# 🗼Day 11 Task: Advance Git & GitHub for DevOps Engineers

## *<mark>Git Stash:</mark>*

Git stash is a command that allows you to temporarily save changes you have made in your working directory, without committing them. This is useful when you need to switch to a different branch to work on something else, but you don't want to commit the changes you've made in your current branch yet.

To use Git stash, you first create a new branch and make some changes to it. Then you can use the command git stash to save those changes. This will remove the changes from your working directory and record them in a new stash. You can apply these changes later. git stash list command shows the list of stashed changes.

***<mark>🗼Here's a basic workflow for using stash in Git</mark>***:

1. **<mark>first, create a branch name then some changes then use the stash command.</mark>**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1699895868549/c5c978c7-e5fc-48c8-87a4-8c989c03b68f.png align="center")
    
    1. ***<mark>After doing some work on the current branch then add and commit</mark>***
        
        How to work stash in git please write some details below
        
        1. currently I am working in Pradeep branch.
            
        2. then doing some work on the branch after some time after saving without add and commit.(Using command: git stash}
            
        3. After working different work on the current branch then add and commit.
            
        4. Then use the command git stash pop to back up.
            
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1699896275151/fab90a32-553f-43ff-bd7c-3c30bcf65eaa.png align="center")
        

# ***🗼<mark>Cherry-pick:</mark>***

***Git cherry-pick is a command that allows you to select specific commits from one branch and apply them to another. This can be useful when you want to selectively apply changes that were made in one branch to another.***

***To use git cherry-pick, you first create two new branches and make some commits to them. Then you use git cherry-pick &lt;commit\_hash&gt; command to select the specific commits from one branch and apply them to the other***.

**<mark>How to work cherry-pick</mark>**

currently, i am working in the Pradeep branch multiple files are created in the branch then added and commit but I want to single commit add on my master branch so please find the SNPs for cherry-pick.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1699898607079/d85c89f6-0406-4ca3-bc42-dbff5d0da58a.png align="center")

### **<mark>Thanks for reading my blog. If you like my blog then follow my profile</mark>**
