question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lost new untracked files

See original GitHub issue

Hello there.

For the second time I experience very strange issue which leads to total lose of unstaged files 😦(((

I had some changes and few new files. I did:

  • git add <one of changed files>
  • git commit

After running all the hooks I can see that all my new files are lost.

Thanks in advance for any help

image

Here is log from console:

cast-call-client on  integrate-tailwindcss [$✘!?] via ⬢ v12.14.1
➜ gst                                                                                                       21:12:54
On branch integrate-tailwindcss
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   .eslintrc
	modified:   package-lock.json
	modified:   packages/client/.flowconfig
	deleted:    packages/client/.storybook/addons.js
	deleted:    packages/client/.storybook/config.js
	deleted:    packages/client/flow-typed/npm/styled-components_v3.x.x.js
	modified:   packages/client/package-lock.json
	modified:   packages/client/package.json
	modified:   packages/client/src/app.jsx
	deleted:    packages/client/src/assets/castcalls-logo.png
	deleted:    packages/client/src/assets/logo_black.png
	modified:   packages/client/src/components/Header.jsx
	modified:   packages/client/src/components/portfolio/PortfolioGrid.stories.jsx
	modified:   packages/client/src/components/portfolio/PortfolioPreview.stories.jsx
	modified:   packages/client/src/components/portfolio/PortfolioTile.stories.jsx
	modified:   packages/client/src/components/portfolio/PortfolioTileWithPreview.stories.jsx
	modified:   packages/client/src/components/portfolio/portfolio-tile/PortfolioTileInfo.stories.jsx
	modified:   packages/client/src/components/subscriptions/stories/InvolvementCard.stories.jsx
	modified:   packages/client/src/components/subscriptions/subscription-grid/SubscriptionGrid.stories.jsx
	modified:   packages/client/src/components/subscriptions/subscription-grid/components/SubscriptionPortfolioTile.stories.jsx
	modified:   packages/client/src/index.jsx
	modified:   packages/client/src/pages/landing/LandingPage.jsx
	modified:   packages/client/src/router/MainRouter.jsx
	modified:   packages/client/src/style-config.js

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	packages/client/.storybook/main.js
	packages/client/.storybook/preview.js
	packages/client/flow-typed/npm/classnames_v2.x.x.js
	packages/client/postcss.config.js
	packages/client/src/assets/Logos/
	packages/client/src/cc-kit/
	packages/client/src/components/Header.stories.jsx
	packages/client/src/tailwind-out.css
	packages/client/src/tailwind.config.js
	packages/client/src/tailwind.css
	packages/client/src/utils/MediaMatcher.js
	packages/tests/package-lock.json

no changes added to commit (use "git add" and/or "git commit -a")

cast-call-client on  integrate-tailwindcss [$✘!?] via ⬢ v12.14.1
➜ ga packages/client/package.json                                                                           21:12:55

cast-call-client on  integrate-tailwindcss [$✘!+?] via ⬢ v12.14.1
➜ gst                                                                                                       21:13:18
On branch integrate-tailwindcss
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   packages/client/package.json

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   .eslintrc
	modified:   package-lock.json
	modified:   packages/client/.flowconfig
	deleted:    packages/client/.storybook/addons.js
	deleted:    packages/client/.storybook/config.js
	deleted:    packages/client/flow-typed/npm/styled-components_v3.x.x.js
	modified:   packages/client/package-lock.json
	modified:   packages/client/src/app.jsx
	deleted:    packages/client/src/assets/castcalls-logo.png
	deleted:    packages/client/src/assets/logo_black.png
	modified:   packages/client/src/components/Header.jsx
	modified:   packages/client/src/components/portfolio/PortfolioGrid.stories.jsx
	modified:   packages/client/src/components/portfolio/PortfolioPreview.stories.jsx
	modified:   packages/client/src/components/portfolio/PortfolioTile.stories.jsx
	modified:   packages/client/src/components/portfolio/PortfolioTileWithPreview.stories.jsx
	modified:   packages/client/src/components/portfolio/portfolio-tile/PortfolioTileInfo.stories.jsx
	modified:   packages/client/src/components/subscriptions/stories/InvolvementCard.stories.jsx
	modified:   packages/client/src/components/subscriptions/subscription-grid/SubscriptionGrid.stories.jsx
	modified:   packages/client/src/components/subscriptions/subscription-grid/components/SubscriptionPortfolioTile.stories.jsx
	modified:   packages/client/src/index.jsx
	modified:   packages/client/src/pages/landing/LandingPage.jsx
	modified:   packages/client/src/router/MainRouter.jsx
	modified:   packages/client/src/style-config.js

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	packages/client/.storybook/main.js
	packages/client/.storybook/preview.js
	packages/client/flow-typed/npm/classnames_v2.x.x.js
	packages/client/postcss.config.js
	packages/client/src/assets/Logos/
	packages/client/src/cc-kit/
	packages/client/src/components/Header.stories.jsx
	packages/client/src/tailwind-out.css
	packages/client/src/tailwind.config.js
	packages/client/src/tailwind.css
	packages/client/src/utils/MediaMatcher.js
	packages/tests/package-lock.json


cast-call-client on  integrate-tailwindcss [$✘!+?] via ⬢ v12.14.1
➜ gc -m 'integrate-tailwindcss'                                                                             21:13:19
husky > pre-commit (node v12.14.1)
  ✔ Preparing...
  ✔ Running tasks...
  ✔ Applying modifications...
  ✔ Cleaning up...
[integrate-tailwindcss 2c1a81f] integrate-tailwindcss
 1 file changed, 15 insertions(+), 4 deletions(-)

cast-call-client on  integrate-tailwindcss [$✘!] via ⬢ v12.14.1 took 2s
➜ gst                                                                                                       21:13:25
On branch integrate-tailwindcss
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   .eslintrc
	modified:   package-lock.json
integrate-tailwindcss
	modified:   packages/client/.flowconfig
	deleted:    packages/client/.storybook/addons.js
	deleted:    packages/client/.storybook/config.js
	deleted:    packages/client/flow-typed/npm/styled-components_v3.x.x.js
	modified:   packages/client/package-lock.json
	modified:   packages/client/src/app.jsx
	deleted:    packages/client/src/assets/castcalls-logo.png
	deleted:    packages/client/src/assets/logo_black.png
	modified:   packages/client/src/components/Header.jsx
	modified:   packages/client/src/components/portfolio/PortfolioGrid.stories.jsx
	modified:   packages/client/src/components/portfolio/PortfolioPreview.stories.jsx
	modified:   packages/client/src/components/portfolio/PortfolioTile.stories.jsx
	modified:   packages/client/src/components/portfolio/PortfolioTileWithPreview.stories.jsx
	modified:   packages/client/src/components/portfolio/portfolio-tile/PortfolioTileInfo.stories.jsx
	modified:   packages/client/src/components/subscriptions/stories/InvolvementCard.stories.jsx
	modified:   packages/client/src/components/subscriptions/subscription-grid/SubscriptionGrid.stories.jsx
	modified:   packages/client/src/components/subscriptions/subscription-grid/components/SubscriptionPortfolioTile.stories.jsx
	modified:   packages/client/src/index.jsx
	modified:   packages/client/src/pages/landing/LandingPage.jsx
	modified:   packages/client/src/router/MainRouter.jsx
	modified:   packages/client/src/style-config.js

no changes added to commit (use "git add" and/or "git commit -a")

Environment

  • OS: macOs Catalina 10.15.1
  • Node.js: 12.14.1
  • lint-staged: 10.0.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:30 (1 by maintainers)

github_iconTop GitHub Comments

14reactions
MikeYermolayevcommented, Jan 27, 2020

Thanks a lot!

Your link helped and I was able to find my files pretty easily by using gitk --all $( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

5reactions
okonetcommented, Jan 27, 2020

🎉 This issue has been resolved in version 10.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it still possible to restore deleted untracked files in git?
10 Answers 10 · CTRL + SHIFT + P · LOOK FOR: "Local History: Find Entry to Restore" · SEARCH FOR DELETED FILE...
Read more >
How to remove untracked files in git - Educative.io
To remove untracked files, use the git clean command. Let's say we have one new file ( file1.txt ) and one new folder...
Read more >
How to remove local untracked files from the current Git branch
Well, the short answer as per the Git Documents is git clean. “How to remove local untracked files from the current Git branch”...
Read more >
How to Properly Remove Untracked Files With Git - CloudBees
In this post, learn how to remove untracked files with Git. We'll begin with a brief explanation followed by examples and best practices....
Read more >
Git loses untracked files during “stash” if there are conficts
“Stashing” then “unstashing” untracked files (new files you've just created) loses those new files, if any of the existing tracked files has a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found