git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Problems rebasing branch after renaming files

From
SISalvatore Iovene <salvatore.iovene@googlemail.com>
Date
Feb 27, 2009, 08:55 UTC
Message-ID
<c64207c00902270055q57442e2dmd81c197419dda71a@mail.gmail.com>

Hi list, I ran into a problem, and I'm unsure it's a git bug or a misuse of mine.

Here's the scenario:
1) Have the master branch and a branch called A
master
|
|----- A
2) Work more in master
master
|
|----- A
|
|
3) Create branch B and work on it. In this branch, rename a directory
containing source files with git-mv
master
|
|----- A
|
|----- B
4) Merge B to master
master
|
|------ A
|
|
|
|
5) Rebase A to master
master
|
|
|
|
|
|----- A

I found that, checking out A, my files in the now renamed directories are as the were in B, i.e. not including the changes made in A, because I have rebased A to master and git didn't realize that the files in old_directory_name are the same as in new_directory_name so they should have been merged.

Either this is a git bug or not, can anyone suggest a way to fix this? All I've thought so far is to git-format-patch the patches that I had in A, use sed to replace the old_directory_name with the new one, create a new branch called A2 at master's head, apply the patches there and git-branch -D A.

Thanks!
PS: please CC me as I'm not on the list.
-- 
Salvatore Iovene
http://www.iovene.com/
http://www.geekherocomic.com/
Next: Jakub Narebski
Message 1 of 2 in “Problems rebasing branch after renaming files”
  1. Salvatore IoveneFeb 27, 2009
  2. Jakub NarebskiFeb 27, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.