,하지만 당신이 볼 경우 git log
일반 : 자식이 실제로 이동을 저장하지 않기 때문에
[[email protected] testgit] echo hello world > foo
[[email protected] testgit] git init
gitInitialized empty Git repository in /home/bd/testgit/.git/
[[email protected] testgit] git add foo
[[email protected] testgit] git commit -m 'test'
[master (root-commit) 772dbe5] test
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 foo
[[email protected] testgit] mv foo bar
[[email protected] testgit] echo baz > quux
[[email protected] testgit] git add quux
[[email protected] testgit] git commit -a -m 'rm; add'
[master 59dd10b] rm; add
2 files changed, 1 insertions(+), 1 deletions(-)
delete mode 100644 foo
create mode 100644 quux
[[email protected] testgit] git add bar
[[email protected] testgit] git commit -m 'add'
[master 823f70f] add
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 bar
[[email protected] testgit] git log --stat -m
commit 823f70fe50828204686a6a42a5e98dc9b258903b
Author: Bryan Donlan <[email protected]>
Date: Mon Jan 17 05:06:16 2011 -0500
add
bar | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
commit 59dd10bfb72bb9005edecb1b7609978d82d21652
Author: Bryan Donlan <[email protected]>
Date: Mon Jan 17 05:05:58 2011 -0500
rm; add
foo | 1 -
quux | 1 +
2 files changed, 1 insertions(+), 1 deletions(-)
commit 772dbe5357253b533f8f2b9c64836dc09a51def4
Author: Bryan Donlan <[email protected]>
Date: Mon Jan 17 05:04:35 2011 -0500
test
foo | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
### As you can see, a log doesn't show the move, but...
[[email protected] testgit] git diff --stat 823f..772d -M
bar => foo | 0
quux | 1 -
2 files changed, 0 insertions(+), 1 deletions(-)
### A direct comparison does
이 동작은/이름 바꾸기 정보 - 추가/제거 된 파일의 내용을 비교하여 파일을 재구성합니다. 직접 비교를 사용하면 이전/이후 상태 만 표시하므로 파일을 추가/제거하는 방법은 중요하지 않습니다. 그러나 git log
을 사용하면 쌍으로 된 개정을 비교하므로 '제거됨'또는 '추가됨'중 하나만 표시됩니다. 둘 다 표시되지 않습니다.
이것이 문제인 경우 git rebase --interactive
을 사용하여 파일 추가 내용을 삭제 한 개정판에 다시 병합 할 수 있습니다. 그러나 나쁜 이력을 가진 개정이 이미 다른 사람에 의해 다운로드 된 경우에는 unwanted side effects이 될 수 있습니다.
감사합니다 - 내가 – Ben
을 두려워했을 때 * git commit --amend * 파일을 추가했습니다. 이 작업을 수행하면 충돌을 일으켰습니다. 즉, * delete * 대신 * add *를 사용하여 해결할 수 있습니다. GitHub는 더 이상 파일 기록을 표시하지 않습니다. 다른 지점을 가져올 때 파일 이동이 감지됩니까? 그렇다면, 나는 가시적 인 파일 역사의 일시적인 손실로 살 수 있습니다. – Ben
정보 : 다른 브랜치를 당겨도 표시되는 파일 기록을 복원하지 않는 것 같습니다. – Ben