How to stash untracked files of the current working directory in Git

0 votes

Hi Team,

I have some untracked files in the working directory. I want to stash untracked files of the current working directory. How can I do that?

Nov 20, 2020 in Git & GitHub by akhtar
• 38,170 points
316 views

1 answer to this question.

0 votes

Hi@akhtar,

In order to stash untracked files, add the “–include-untracked” option to your “git stash” initial command. Alternatively, you can simply use the “-u” which is equivalent to the untracked longer version.

$ git stash --include-untracked
Saved working directory and index state WIP on branch1: 808b598 Initial commit
$ git stash -u
answered Nov 20, 2020 by MD
• 95,180 points

Related Questions In Git & GitHub

0 votes
1 answer

How to save files in Git Stash?

Hi@akhtar, Git Stash temporarily save changes you've made to ...READ MORE

answered Nov 20, 2020 in Git & GitHub by MD
• 95,180 points
173 views
0 votes
1 answer

How to list all the files in a commit in Git?

Hi@akhtar, Using git diff-tree is considered as a preferred way ...READ MORE

answered Dec 22, 2020 in Git & GitHub by MD
• 95,180 points
97 views
0 votes
1 answer

How to get the current branch name in Git?

Hi@akhtar, You can run the git branch command ...READ MORE

answered Dec 22, 2020 in Git & GitHub by MD
• 95,180 points
738 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,076 views
+2 votes
1 answer
+1 vote
1 answer

How to remove untracked files from the current Git working tree?

Hi@akhtar, If you have thousands of file then ...READ MORE

answered Sep 4, 2020 in Git & GitHub by MD
• 95,180 points
213 views
0 votes
1 answer

How to find the hidden files in the Git repository?

Hi@akhtar, To find the hidden files in the ...READ MORE

answered Nov 19, 2020 in Git & GitHub by MD
• 95,180 points
702 views