How to save files in Git as Temporary Purpose ?


while working in any project, we will get the requirement to work on many story or bug fixing task at same time. Some will be high priority task and other will be low.

If we are working on some predefined story and at same time we will get requirement to work on high priority bug fixing task then we have to stop our story and pick the high priority task. For this scenario we have to save our working files in some temporary location.

We can do this task using git stash very easily.

1. How to save the working files as temporary purpose

$ git stash save “New method to display Name”

2. How to view the stash files list

$ git stash list

3. How to apply the save files in working branch

$ git stash apply stash@{0}

4. Stashing untracked or ignored files

$ git stash -u

5. Viewing stash diffs

$ git stash show
OR
$ git stash show -p

6. Cleaning up your stash

$ git stash drop stash@{1}

7. Deleting all the stashes

$ git stash clear

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.