git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to commit changes if remote repository changed directory structure?
@ 2009-03-20  1:17 andholt
  2009-03-20  6:09 ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: andholt @ 2009-03-20  1:17 UTC (permalink / raw)
  To: git


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?

Thanks!
-- 
View this message in context: http://www.nabble.com/How-to-commit-changes-if-remote-repository-changed-directory-structure--tp22612715p22612715.html
Sent from the git mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to commit changes if remote repository changed directory structure?
  2009-03-20  1:17 How to commit changes if remote repository changed directory structure? andholt
@ 2009-03-20  6:09 ` Jeff King
  2009-03-20  7:08   ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff King @ 2009-03-20  6:09 UTC (permalink / raw)
  To: andholt; +Cc: git

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to commit changes if remote repository changed directory structure?
  2009-03-20  6:09 ` Jeff King
@ 2009-03-20  7:08   ` Junio C Hamano
  2009-03-20  7:13     ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2009-03-20  7:08 UTC (permalink / raw)
  To: Jeff King; +Cc: andholt, git

Jeff King <peff@peff.net> writes:

> 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. :)

We should probably point out to new people that "first commit and then
worry about merges after your changes are safely committed" is always how
people would "go about" anything.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to commit changes if remote repository changed directory structure?
  2009-03-20  7:08   ` Junio C Hamano
@ 2009-03-20  7:13     ` Jeff King
  2009-03-20 22:30       ` J. Bruce Fields
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff King @ 2009-03-20  7:13 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: J. Bruce Fields, andholt, git

On Fri, Mar 20, 2009 at 12:08:51AM -0700, Junio C Hamano wrote:

> > First, commit your changes. Then merge the other developer's changes. :)
> 
> We should probably point out to new people that "first commit and then
> worry about merges after your changes are safely committed" is always how
> people would "go about" anything.

Yes, absolutely.

Most of the current documentation focuses on being a reference to
particular commands or tasks. But this is more of a "philosophy of
working with git" item. I guess it should go in the user manual
somewhere. Cc'ing Bruce, who may have some comments.

-Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to commit changes if remote repository changed directory structure?
  2009-03-20  7:13     ` Jeff King
@ 2009-03-20 22:30       ` J. Bruce Fields
  0 siblings, 0 replies; 5+ messages in thread
From: J. Bruce Fields @ 2009-03-20 22:30 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, andholt, git

On Fri, Mar 20, 2009 at 03:13:19AM -0400, Jeff King wrote:
> On Fri, Mar 20, 2009 at 12:08:51AM -0700, Junio C Hamano wrote:
> 
> > > First, commit your changes. Then merge the other developer's changes. :)
> > 
> > We should probably point out to new people that "first commit and then
> > worry about merges after your changes are safely committed" is always how
> > people would "go about" anything.
> 
> Yes, absolutely.
> 
> Most of the current documentation focuses on being a reference to
> particular commands or tasks. But this is more of a "philosophy of
> working with git" item. I guess it should go in the user manual
> somewhere. Cc'ing Bruce, who may have some comments.

I agree, that's kind of an odd hold in the user manual.  Maybe it goes
without saying, but it might be useful somewhere in ch. 3, maybe when
introducing commits, something along the lines of: "note all of these
commits are stored only in your local repository, and are visible only
to you.  With some version control systems, "committing" requires
sending the commit to a central server.  With git, you are expected to
do all your work locally and only merge with others' work when
necessary; we'll learn how to do that in <chapter 4>."

And then say something similar again at the start of chapter 4?

--b.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-20 22:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-20  1:17 How to commit changes if remote repository changed directory structure? andholt
2009-03-20  6:09 ` Jeff King
2009-03-20  7:08   ` Junio C Hamano
2009-03-20  7:13     ` Jeff King
2009-03-20 22:30       ` J. Bruce Fields

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).