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

Some git mv questions

From
JWJan Wielemaker <wielemak@science.uva.nl>
Date
Oct 16, 2007, 15:33 UTC
Message-ID
<200710161733.49185.wielemak@science.uva.nl>
Hi,
For the impatient, start [HERE].

I'm about to start shuffling files and directories around in a big project, while others keep working on their files. This is a bit scary as I still feel pretty much newbie in the GIT world :-)

I did a little test as follows. Given a shared repository sandbox.git with a file in there I did the following, which worked fine.

	* [player one] clone the DB, edit the file, commit and push
	* [player two] clone the DB
		- git branch shuffle
		- git checkout shuffle
		- mkdir SomeDir
		- git mv file SomeDir
		- edit SomeDir/file
		- git commit -a
	* Sofar so good, now merge:
		- git checkout master
		- git pull (get player 1 changes)
		- git merge shuffle
		- git branch -d shuffle
		- git commit -a
		- git push
Sofar so good, but during the tests I had two times problems:
	* Instead of "git mv file SomeDir" I simply used "mv file SomeDir"
	and git-add.  Now I end up with two files and of course the changes
	are not merged.  I can understand that.
[HERE]
	* On a somewhat bigger test I moved a large directory using
	"git mv dir newdir" (where newdir is an existing directory).
	Now "git status" gives a lot of new and deleted files!?  I
	guess I'm going to have a big mess if that happens in the
	real project.  Moving some smaller test directories simply
	showed a series of renames.
	Can this be explained?  Is this a bug?
	Thanks --- Jan
Next: Lars Hjemli
Message 1 of 4 in “Some git mv questions”
  1. Jan WielemakerOct 16, 2007
  2. Lars HjemliOct 16, 2007
  3. Linus TorvaldsOct 16, 2007
  4. Jan WielemakerOct 16, 2007

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.