What does the command git stash do

0 votes

What does the command git stash do?

I’m working with Git and keep seeing the git stash command mentioned. Can someone explain what it actually does? I often find myself needing to switch branches but don’t want to commit unfinished changes. How does git stash handle these changes, and how can I retrieve them later

Oct 29 in Web Development by Nidhi
• 4,940 points
133 views

1 answer to this question.

0 votes

Sometimes you want to switch the branches, but you are working on an incomplete part of your current project. You don't want to make a commit of half-done work. Git stashing allows you to do so. The git stash command enables you to switch branches without committing the current branch.

Generally, the stash's meaning is "store something safely in a hidden place." The sense in Git is also the same for stash; Git temporarily saves your data safely without committing.

Syntax:

  1. $ git status  

Stashing takes the messy state of your working directory, and temporarily save it for further use. Many options are available with git stash. Some useful options are given below:

  • Git stash
  • Git stash save
  • Git stash list
  • Git stash apply
  • Git stash changes
  • Git stash pop
  • Git stash drop
  • Git stash clear
  • Git stash branch

answered Oct 29 by kavya

Related Questions In Web Development

0 votes
1 answer

What is the command to merge branches in Git?

To merge branches in Git you can ...READ MORE

answered Nov 6 in Web Development by kavya
84 views
0 votes
1 answer

What does cors means in Angularjs and what the use of it?

CORS is Cross Origin Resource Sharing which means you ...READ MORE

answered Jan 29, 2020 in Web Development by kartik
• 37,520 points
4,356 views
0 votes
1 answer

What do the three dots (...) mean in React JSX?

In react, by using the three dots ...READ MORE

answered Nov 19 in Web Development by kavya
59 views
0 votes
1 answer

How do you view the commit history in Git?

To display commit history with full messages: git ...READ MORE

answered Dec 6 in Web Development by Navya
37 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,083 views
+2 votes
1 answer
0 votes
1 answer

What is the purpose of z-index in CSS?

The z-index CSS property sets the z-order of a positioned element and ...READ MORE

answered Oct 29 in Web Development by kavya
91 views
0 votes
1 answer

How do I write my own MVC framework?

Let’s see what MVC stands for : Modal ...READ MORE

answered Oct 21 in Web Development by Navya
• 380 points
157 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP