git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: andholt <andholt@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: How to commit changes if remote repository changed directory structure?
Date: Fri, 20 Mar 2009 02:09:26 -0400	[thread overview]
Message-ID: <20090320060926.GC27008@coredump.intra.peff.net> (raw)
In-Reply-To: <22612715.post@talk.nabble.com>

On Thu, Mar 19, 2009 at 06:17:15PM -0700, andholt wrote:

> I have a lot of local changes to add, commit, and push. Right now our
> directory structure is 1/2/3. Another developer decided to move everything
> up one level, so used git move to move 3 to 2, and removed 3, so now the
> level is 1/2. However, locally, all of my changes are in 1/2/3. 
> 
> I want to commit my changes and merge them into the new directory structure.
> How would I go about doing that?

First, commit your changes. Then merge the other developer's changes. :)

This is exactly the sort of case that git's rename detection should
handle; it should detect that the other side renamed files, and then
consider your changes against the newly named files. The only thing it
_won't_ handle is new files that you added in 1/2/3. You will have to
manually move them to 1/2 as part of the merge (there has been
discussion of "detect that this whole directory seems to have had its
content moved and automatically move new files", but the patches have
not been accepted).

-Peff

  reply	other threads:[~2009-03-20  6:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-20  1:17 How to commit changes if remote repository changed directory structure? andholt
2009-03-20  6:09 ` Jeff King [this message]
2009-03-20  7:08   ` Junio C Hamano
2009-03-20  7:13     ` Jeff King
2009-03-20 22:30       ` J. Bruce Fields

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

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

  git send-email \
    --in-reply-to=20090320060926.GC27008@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=andholt@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.
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 NNTP newsgroup(s).