git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Adam A <hitsthings@gmail.com>
To: git@vger.kernel.org
Subject: Re: Bug: Pulling remotes into an empty repo deletes the index
Date: Sat, 3 Aug 2013 22:01:30 +1000	[thread overview]
Message-ID: <CAJOTJ-Cgdg4CQs-3t1CsBkq_feVEpkoASzQSTATiVugjs+LL7w@mail.gmail.com> (raw)
In-Reply-To: <CAJOTJ-AVamimToPo4oQ=O_Pg+mJHQhardO+NfU8b1dvRxg1KMA@mail.gmail.com>

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 <hitsthings@gmail.com> 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

       reply	other threads:[~2013-08-03 12:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAJOTJ-AVamimToPo4oQ=O_Pg+mJHQhardO+NfU8b1dvRxg1KMA@mail.gmail.com>
2013-08-03 12:01 ` Adam A [this message]
2013-08-03 16:39   ` Bug: Pulling remotes into an empty repo deletes the index Daniel Convissor
2013-08-03 16:57     ` Jonathan Nieder
2013-08-03 17:01       ` Daniel Convissor
2013-08-03 21:46       ` Adam A
2013-08-10  7:33       ` Jeff King
2013-08-03 16:59     ` Daniel Convissor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJOTJ-Cgdg4CQs-3t1CsBkq_feVEpkoASzQSTATiVugjs+LL7w@mail.gmail.com \
    --to=hitsthings@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).