

10 years, 5 months ago Another example is if you work on two computer, and you're allowed to move data from A to B, but not from B to A. Not stashing (and cleaning) new files is broken behaviour.
SOURCETREE STASH NEW FILES MANUAL
10 years, 8 months ago Cool - it finally works as described in the manual page. Say the untracked file is a (half-written) unit test, and the testing harness runs all unit tests in the directory. 10 years, 8 months ago It depends on the project. 11 years, 2 months ago what I meant in my comment was that it doesn't stash new files unless they have been staged however it does stash existing files even if they haven't been staged. The point is to have a clean working tree after stashing. 11 years, 4 months ago Why does stash still stash changed existing files even though those changes haven't been staged? 11 years, 2 months ago Read the DESCRIPTION of /pub/software/scm/git/docs/git-stash.html. See my answer for a solution to this problem. Hopefully this answer is helpful to someone, putting everything together all in one answer.ġ1 years, 8 months ago Related Topics git git-stash Comments 11 years, 11 months ago What if you don't want to stash changes that are already in the index? Is stashing the new file still possible? 11 years, 8 months ago As far as I can tell, the former doesn't work, either. zshrc or equivalent to make exist long-term. Git stash save "don't forget to un-add path/to/untracked-file" # stash w/reminder So, what can you do? Well, you have to truly add the file, however, you can effectively un-add it later, with git rm -cached: git add path/to/untracked-file This will fail, as follows: path/to/untracked-file: not added yetįatal: git-write-tree: error building trees And the following will NOT work: git add -N path/to/untracked/file # note: -N is short for -intent-to-add However, the question is also raised in another answer: What if you don't really want to add the file? Well, as far as I can tell, you have to. This gave back to me my ability to work on the same project in eclipse.Īs has been said elsewhere, the answer is to git add the file. This pasted the same files back in my workspace. Once this was done successfully, I used git stash pop I proceeded on with completing the procedure for pushing the committed files to remote. Absence of these files takes away my capability of working on my work location in eclipse. project file, I used git stash -include-untrackedĪnd it removed the files from my workspace. classpath are not stashed.įor stashing the modified. gitIgnore fiels and the untracked files viz.project and. However, final push cannot be performed unless the modified. I first of all selectively added my rest of the files and committed for staging. project files are important for eclipse - which is my java editor. I had to perform a modification to my gitIgnore file to avoid movement of. This will place the file back in your local workspace.

And you can revert git stash by using following commands git stash pop Git stash removes any untracked or uncommited files from your workspace. In git bash, stashing of untracked files is achieved by using the command git stash -include-untracked
