{"thread":{"id":"17249","subject":"how to omit rename file when commit","startedAt":"2009-01-19T09:13:57Z","lastAt":"2009-01-19T17:41:02Z","messageCount":5,"participants":["Frank Li","Junio C Hamano","Jakub Narebski","Boyd Stephen Smith Jr."],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"101113","messageId":"1976ea660901190113l5407f108lff8f37d9a8331f58@mail.gmail.com","threadId":"17249","inReplyTo":null,"subject":"how to omit rename file when commit","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2009-01-19T09:13:57Z","receivedAt":"2009-01-19T09:13:57Z","isPatch":false,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":"For example there are a file a.c at git repository.\nuse\ngit mv a.c b.c\n\ngit status:\n# On branch master\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#       renamed:    a.c -> b.c\n\nIf we don't want to stage this change at this commit,  what can I do?\n"},{"id":"101115","messageId":"7v63kbr6zc.fsf@gitster.siamese.dyndns.org","threadId":"17249","inReplyTo":"1976ea660901190113l5407f108lff8f37d9a8331f58@mail.gmail.com","subject":"Re: how to omit rename file when commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-19T09:16:23Z","receivedAt":"2009-01-19T09:16:23Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Frank Li\" <lznuaa@gmail.com> writes:\n\n> For example there are a file a.c at git repository.\n> use\n> git mv a.c b.c\n>\n> git status:\n> # On branch master\n> # Changes to be committed:\n> #   (use \"git reset HEAD <file>...\" to unstage)\n> #\n> #       renamed:    a.c -> b.c\n>\n> If we don't want to stage this change at this commit,  what can I do?\n\nI may be misunderstanding what you want to do, but wouldn't \"git mv b.c\na.c\" undo whatever you did?\n"},{"id":"101117","messageId":"1976ea660901190135k71087673p85e995878e539a8f@mail.gmail.com","threadId":"17249","inReplyTo":"7v63kbr6zc.fsf@gitster.siamese.dyndns.org","subject":"Re: how to omit rename file when commit","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2009-01-19T09:35:41Z","receivedAt":"2009-01-19T09:35:41Z","isPatch":false,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":"For example:\nthere are 2 file. a.c and e.c\nI modify e.c.\nand git mv a.c b.c\n\ngit update-index e.c\n\nI just want to commit e.c and don't commit rename(a.c -> b.c)\n\nI am debuging a tortoisegit.  at commit dialog, there will be show all\nchanged as\n[x] rename (a.c => b.c)\n[x] modify (e.c)\nbutton [OK]\n\nassume user uncheck rename\n[]rename (a.c=>b.c)\n[x]modify (e.c)\n\nthen click okay.\n\nI don't know use which git command to handle this case.\nif git mv b.c a.c, local working copy will be changed.\n\n\n2009/1/19 Junio C Hamano <gitster@pobox.com>:\n> \"Frank Li\" <lznuaa@gmail.com> writes:\n>\n>> For example there are a file a.c at git repository.\n>> use\n>> git mv a.c b.c\n>>\n>> git status:\n>> # On branch master\n>> # Changes to be committed:\n>> #   (use \"git reset HEAD <file>...\" to unstage)\n>> #\n>> #       renamed:    a.c -> b.c\n>>\n>> If we don't want to stage this change at this commit,  what can I do?\n>\n> I may be misunderstanding what you want to do, but wouldn't \"git mv b.c\n> a.c\" undo whatever you did?\n>\n>\n"},{"id":"101121","messageId":"m3vdsby2y4.fsf@localhost.localdomain","threadId":"17249","inReplyTo":"1976ea660901190135k71087673p85e995878e539a8f@mail.gmail.com","subject":"Re: how to omit rename file when commit","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-01-19T11:01:47Z","receivedAt":"2009-01-19T11:01:47Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\"Frank Li\" <lznuaa@gmail.com> writes:\n\n> For example:\n> there are 2 file. a.c and e.c\n> I modify e.c.\n> and git mv a.c b.c\n> \n> git update-index e.c\n> \n> I just want to commit e.c and don't commit rename(a.c -> b.c)\n\nThe simplest way (but I'm not sure if it is what you want) would be\n\n  $ git commit e.c\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"101148","messageId":"200901191141.07440.bss@iguanasuicide.net","threadId":"17249","inReplyTo":"1976ea660901190135k71087673p85e995878e539a8f@mail.gmail.com","subject":"Re: how to omit rename file when commit","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss@iguanasuicide.net","sentAt":"2009-01-19T17:41:02Z","receivedAt":"2009-01-19T17:41:02Z","isPatch":false,"sender":{"key":"bss@iguanasuicide.net","avatar":"https://gravatar.com/avatar/84b95eeff194b816c1568b1339e63e4b229825298664a9037b9f1ec713ead1e3?d=mp&s=160"},"body":"On Monday 2009 January 19 03:35:41 you wrote:\n>For example:\n>there are 2 file. a.c and e.c\n>I modify e.c.\n>and git mv a.c b.c\n>\n>git update-index e.c\n>\n>I just want to commit e.c and don't commit rename(a.c -> b.c)\n\nHere, it looks like all you need to do is follow the instructions given by git \nstatus--use \"git reset HEAD\" on each file you want unstaged:\n$ rm -rf test && mkdir test\n$ cd test\n/home/bss/test\n$ git init\nInitialized empty Git repository in /home/bss/test/.git/\n$ echo b > a.c; echo d > e.c\n$ git add a.c b.c e.c\n$ git commit -m 'Setup'\nCreated initial commit fc9d26e: Setup\n 2 files changed, 2 insertions(+), 0 deletions(-)\n create mode 100644 a.c\n create mode 100644 e.c\n$ git mv a.c b.c\n$ echo e > e.c\n$ git add e.c\n$ git status\n# On branch master\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#       renamed:    a.c -> b.c\n#       modified:   e.c\n#\n$ git reset HEAD -- a.c b.c\na.c: locally modified\n$ git status\n# On branch master\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#       modified:   e.c\n#\n# Changed but not updated:\n#   (use \"git add/rm <file>...\" to update what will be committed)\n#\n#       deleted:    a.c\n#\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#       b.c\n$ git commit -m 'e.c: Fix typo'\nCreated commit c23b226: e.c: Fix typo\n 1 files changed, 1 insertions(+), 1 deletions(-)\n$ git status\n# On branch master\n# Changed but not updated:\n#   (use \"git add/rm <file>...\" to update what will be committed)\n#\n#       deleted:    a.c\n#\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#       b.c\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n\nHTH.\n-- \nBoyd Stephen Smith Jr.                     ,= ,-_-. =. \nbss@iguanasuicide.net                     ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' \nhttp://iguanasuicide.net/                      \\_/     \n"}]}