Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7966759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:31:03+00:00 2026-06-04T06:31:03+00:00

I have a git repo that has a directory full of user uploaded files.

  • 0

I have a git repo that has a directory full of user uploaded files. The directory also contains a .gitignore */.

I did a pull from a remote repo and all of those files in the directory were deleted without warning.

What could have caused this to happen?

All of the research I have done tells me it is a deliberate action to delete all of those files and not possible to do by accident. Is that true or is there another git command that will silently delete all of those files?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:31:04+00:00Added an answer on June 4, 2026 at 6:31 am

    .gitignore is a convenience that keeps noise from showing up on status reports or being automatically added by git add . and the like, that’s all. You can explicitly add an ignored file and git will then care about that particular file anyway, and naming a file in .gitignore won’t make git stop caring about an already-tracked file.

    If git pull deleted files, then those files were tracked and deleted. You can get them back by git checkout "@{may 21 17:30 pdt}" or some such ref for your checked-out commit as of the pull.

    It’s remotely possible that someone added the files, didn’t commit the changes, and forced the merge, making the orphans harder to find, but unless someone explicitly wiped git’s memory git fsck --lost-found is like the old undelete programs, it’ll drop copies of everything you ever cared about but then discarded into .git/lost-found.

    git ls-files -ic --exclude-standard will show you tracked files that match an ignore spec, i.e. files that somebody might have added or ignored by mistake. Come to think of it, that might not be a bad line for a pre-commit hook,

    git ls-files -ic --exclude-standard \
    | sed '${p;s,.*,*** '"$0"' refusing commit with tracked files marked as ignored in the standard excludes lists,;q1}'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a git repo that has a docs directory where I keep markdown
I have a fresh git-svn repo (11.13 GB) that has over a 100,000 objects
I have a repo that has two files that supposedly I changed locally. So
I have a Git repo that has been acting funny. I can checkout all
So I have a project (private repo) that has multiple submodules (also private). I
I have a git repo with a bunch of source code, and when that
I have a project that's using git. When I received the repo, it had
Suppose I have Git repository like this: git-repo/ directory_1/ directory_2/ directory_3/ This has a
I have a git repo which has a few branches - there's the master
I have machine1 with git repo client , which has branches master and fixes_v3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.