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

  • Home
  • SEARCH
  • 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 7652719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:50:37+00:00 2026-05-31T11:50:37+00:00

I host a small development server on my system. From that working directory I

  • 0

I host a small development server on my system. From that working directory I created a bare git repo. From there myself and 1 other user pulled the repo to local systems.

I since thought the other user stopped using the git repo. So I was working directly on the working files directly “on the server” (which is my system).

Randomly this morning the other user pushed to the repo. BAM, all of my files were immediately removed. The entire folder structure was replaced with his copy.

I thought GIT was supposed to tell him – woah hey, these files don’t match! pull first! but it did nothing! just – BAM, remove all my work.

So now I am stuck, all of my files are gone – I checked the log on the repo and it shows his push – but it doesn’t mention a thing about removing my files – only adding his.

I should note that I setup the bare repo using some tutorials out there dealing with using a repo to directly control working files on a web server.as such the repo has the following post.update hook:

    echo "***Updating Server Files***"
    GIT_WORK_TREE=//myserver/myfolder git checkout -f

Are my files gone forever?

  • 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-05-31T11:50:38+00:00Added an answer on May 31, 2026 at 11:50 am

    The git checkout man page has this to say about the -f (or “force”) flag for checkout that you put in your post-update hook:

    Proceed even if the index or the working tree differs from HEAD. This is used to throw away local changes.

    If you had been still using a “local” repo and pushing yourself to update the server, you’d be fine no matter what your other user had done, because your local commits and files would be untouched.

    But if, as it seems, you were just making changes directly, and ignoring the Git part of your setup, your changes are probably gone (barring any backups you might have made, of course). As far as Git’s concerned, all the stuff it wiped out was just “local changes.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a few small flash widgets that stream .mp3 audio from an
I have a small server problem when working with LAMPP and WAMP server in
I have small HTTP server script that receives HTTP client requests and replies. I
I've got a small WCF webservice working with the built-in WCF Service Host and
I have a small c# server that allows silverlight clients to connect to it.
For my project I wrote a small config class that loads its data from
So, I have a dedicated server. I host about dozen or so small sites.
I'm working on a small Ruby program that will connect to a remote MySQL
I'm learning Windows kernel mode driver development. I've written a small test driver that
I'm writing a socket server designed to only host a small number of client

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.