From: Adam A Date: Sat, 03 Aug 2013 12:01:30 GMT Subject: Re: Bug: Pulling remotes into an empty repo deletes the index Message-ID: In-Reply-To: Hello, the project readme on github points here for submitting bug reports, but please let me know if I'm in the wrong place. Steps to reproduce: - create a remote repository at URL with commit(s) in it - e.g., a new github repo with README and LICENSE files auto-added - write some files in a local directory - git init - git add . - the contents of the directory are now in the index - git remote add origin URL - git pull origin master The local files added to the index are now completely wiped out and replaced with the remote content. I lose all my previous work. :/ This was pretty painful for me to lose a few days of work. I also couldn't stash my changes which I tried first, but git refused without an initial commit. Would have been nice if git warning me about the destructive operation. Cheers, Adam On Sat, Aug 3, 2013 at 9:57 PM, Adam A wrote: > Hello, the project readme on github points here for submitting bug reports, > but please let me know if I'm in the wrong place. > > Steps to reproduce: > > - create a remote repository at URL with commit(s) in it > - e.g., a new github repo with README and LICENSE files auto-added > - write some files in a local directory > - git init > - git add . > - the contents of the directory are now in the index > - git remote add origin URL > - git pull origin master > > The local files added to the index are now completely wiped out and replaced > with the remote content. I lose all my previous work. :/ > > This was pretty painful for me to lose a few days of work. I also couldn't > stash my changes which I tried first, but git refused without an initial > commit. > > Would have been nice if git warning me about the destructive operation. > > Cheers, > Adam