Where did git put my files?

Michael keybounce at gmail.com
Fri Apr 27 01:38:13 UTC 2018


On 2018-04-26, at 5:01 PM, Ryan Schmidt <ryandesign at macports.org> wrote:

> To do this, I was first required to stash or commit my unfinished work. I used git stash, followed by git checkout my-other-branch. After finishing work there, I returned to my original branch with git checkout my-original-branch, and restored my stashed work with git stash pop. But the /dist/ directory is now gone.
> 
> Where did git put these files? The /dist/ directory is mentioned in .gitignore. Did it delete them?

If you have some directory mentioned in .gitignore, then git will ignore it. It will not delete the files on stash. It will not bother them on checkout. If your development on the new branch results in their being deleted, then they will be gone. When you check out the original branch, git does nothing with the directory. And when you pop the stash, also nothing happens.

So the question is, what did you do to the dist directory when working in the other branch?

The second question is, is the .gitignore file itself versioned? If so, and dist is not ignored on the other branch, then when you saved the other branch, you saved the dist directory. In this case, it will be saved in the other branch and removed when you check out the new/original work branch.

---
Entertaining minecraft videos
http://YouTube.com/keybounce



More information about the macports-dev mailing list