How to log the entire git history of a file that is renamed/moved using its old path?How to remove local (untracked) files from the current Git working tree?How do I migrate an SVN repository with history to a new Git repository?View the change history of a file using Git versioningGit for beginners: The definitive practical guideIs there a quick Git command to see an old version of a file?Git workflow and rebase vs merge questionsHow do I force “git pull” to overwrite local files?How to make Git “forget” about a file that was tracked but is now in .gitignore?Handling file renames in gitHow do I rename a local Git branch?
Converting Geographic Coordinates into Lambert2008 coordinates
How do we separate rules of logic from non-logical constraints?
Who voices the character "Finger" in The Fifth Element?
How to get a character's limb regrown at 3rd level?
Can you actually break an FPGA by programming it wrong?
How do I ensure my employees don't abuse my flexible work hours policy?
How does the Divination wizard's Expert Divination feature work when you upcast a divination spell?
Company threatening to call my current job after I declined their offer
Single level file directory
Bin Packing with Relational Penalization
I just started should I accept a farewell lunch for a coworker I don't know?
What do you call a notepad used to keep a record?
for xml path('') output
How did researchers find articles before the Internet and the computer era?
Thin wall to block LED light from hitting photodiode?
Can a nowhere continuous function have a connected graph?
How to securely dispose of a smartphone?
Closest Proximity of Oceans to Freshwater Springs
Journal standards vs. personal standards
How did Lefschetz do mathematics without hands?
How can I tell what kind of genitals people have without gender?
How Do I Know When I am in Private Mode?
Can one use the present progressive or gerund like an adjective?
Most elegant way to write a one-shot 'if'
How to log the entire git history of a file that is renamed/moved using its old path?
How to remove local (untracked) files from the current Git working tree?How do I migrate an SVN repository with history to a new Git repository?View the change history of a file using Git versioningGit for beginners: The definitive practical guideIs there a quick Git command to see an old version of a file?Git workflow and rebase vs merge questionsHow do I force “git pull” to overwrite local files?How to make Git “forget” about a file that was tracked but is now in .gitignore?Handling file renames in gitHow do I rename a local Git branch?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
If a file, A
, is edited one or more times, then renamed/moved to B
and edited one or more times as B
, issuing the following git command using its new name/path ...
git log --follow -- B
... shows its entire history.
However, when I'm looking at an old (released/maintained) branch of the same project where the file is still named A
and I want to backport changes done to it in master
, I might think that issuing the following on master
...
git log --follow -- A
... will show me all changes. But it does not. The latest commit displayed in the log is the change corresponding to the rename from A
to B
. Changes done to B
are not shown.
i.e. --follow
only follows renames "backwards" from a newer name to an older one, but not "forwards".
At this point, I have to first identify that the latest commit displayed is a rename, find the newer name, and issue a git log --follow
again with the new name (and potentially repeat this several times if the file was moved around a few times since the maintained release.
How can I find the entire history without having to manually issue git log --follow
several times?
git version-control
add a comment |
If a file, A
, is edited one or more times, then renamed/moved to B
and edited one or more times as B
, issuing the following git command using its new name/path ...
git log --follow -- B
... shows its entire history.
However, when I'm looking at an old (released/maintained) branch of the same project where the file is still named A
and I want to backport changes done to it in master
, I might think that issuing the following on master
...
git log --follow -- A
... will show me all changes. But it does not. The latest commit displayed in the log is the change corresponding to the rename from A
to B
. Changes done to B
are not shown.
i.e. --follow
only follows renames "backwards" from a newer name to an older one, but not "forwards".
At this point, I have to first identify that the latest commit displayed is a rename, find the newer name, and issue a git log --follow
again with the new name (and potentially repeat this several times if the file was moved around a few times since the maintained release.
How can I find the entire history without having to manually issue git log --follow
several times?
git version-control
2
You can't always trace every move/rename operation, because sometimes Git can't figure it out. Not an answer, but the best bet is to avoid moving/renaming files in Git, if you can manage that.
– Tim Biegeleisen
Mar 25 at 14:01
1
I don't think there's a great solution for this because Git doesn't really move forwards in history like you describe, but I can recommend the flag--name-status
forgit log
(and others) which shows you what kinds of changes were made to each file in each commit (e.g.M
= modified,R
= renamed).
– Jan Krüger
Mar 25 at 15:39
@JanKrüger, nice! Agit log --oneline --name-status
without a pathspec is a pretty good candidate for grepping through and looking for renames.
– ArjunShankar
Mar 26 at 10:53
add a comment |
If a file, A
, is edited one or more times, then renamed/moved to B
and edited one or more times as B
, issuing the following git command using its new name/path ...
git log --follow -- B
... shows its entire history.
However, when I'm looking at an old (released/maintained) branch of the same project where the file is still named A
and I want to backport changes done to it in master
, I might think that issuing the following on master
...
git log --follow -- A
... will show me all changes. But it does not. The latest commit displayed in the log is the change corresponding to the rename from A
to B
. Changes done to B
are not shown.
i.e. --follow
only follows renames "backwards" from a newer name to an older one, but not "forwards".
At this point, I have to first identify that the latest commit displayed is a rename, find the newer name, and issue a git log --follow
again with the new name (and potentially repeat this several times if the file was moved around a few times since the maintained release.
How can I find the entire history without having to manually issue git log --follow
several times?
git version-control
If a file, A
, is edited one or more times, then renamed/moved to B
and edited one or more times as B
, issuing the following git command using its new name/path ...
git log --follow -- B
... shows its entire history.
However, when I'm looking at an old (released/maintained) branch of the same project where the file is still named A
and I want to backport changes done to it in master
, I might think that issuing the following on master
...
git log --follow -- A
... will show me all changes. But it does not. The latest commit displayed in the log is the change corresponding to the rename from A
to B
. Changes done to B
are not shown.
i.e. --follow
only follows renames "backwards" from a newer name to an older one, but not "forwards".
At this point, I have to first identify that the latest commit displayed is a rename, find the newer name, and issue a git log --follow
again with the new name (and potentially repeat this several times if the file was moved around a few times since the maintained release.
How can I find the entire history without having to manually issue git log --follow
several times?
git version-control
git version-control
asked Mar 25 at 13:59
ArjunShankarArjunShankar
17.6k4 gold badges52 silver badges74 bronze badges
17.6k4 gold badges52 silver badges74 bronze badges
2
You can't always trace every move/rename operation, because sometimes Git can't figure it out. Not an answer, but the best bet is to avoid moving/renaming files in Git, if you can manage that.
– Tim Biegeleisen
Mar 25 at 14:01
1
I don't think there's a great solution for this because Git doesn't really move forwards in history like you describe, but I can recommend the flag--name-status
forgit log
(and others) which shows you what kinds of changes were made to each file in each commit (e.g.M
= modified,R
= renamed).
– Jan Krüger
Mar 25 at 15:39
@JanKrüger, nice! Agit log --oneline --name-status
without a pathspec is a pretty good candidate for grepping through and looking for renames.
– ArjunShankar
Mar 26 at 10:53
add a comment |
2
You can't always trace every move/rename operation, because sometimes Git can't figure it out. Not an answer, but the best bet is to avoid moving/renaming files in Git, if you can manage that.
– Tim Biegeleisen
Mar 25 at 14:01
1
I don't think there's a great solution for this because Git doesn't really move forwards in history like you describe, but I can recommend the flag--name-status
forgit log
(and others) which shows you what kinds of changes were made to each file in each commit (e.g.M
= modified,R
= renamed).
– Jan Krüger
Mar 25 at 15:39
@JanKrüger, nice! Agit log --oneline --name-status
without a pathspec is a pretty good candidate for grepping through and looking for renames.
– ArjunShankar
Mar 26 at 10:53
2
2
You can't always trace every move/rename operation, because sometimes Git can't figure it out. Not an answer, but the best bet is to avoid moving/renaming files in Git, if you can manage that.
– Tim Biegeleisen
Mar 25 at 14:01
You can't always trace every move/rename operation, because sometimes Git can't figure it out. Not an answer, but the best bet is to avoid moving/renaming files in Git, if you can manage that.
– Tim Biegeleisen
Mar 25 at 14:01
1
1
I don't think there's a great solution for this because Git doesn't really move forwards in history like you describe, but I can recommend the flag
--name-status
for git log
(and others) which shows you what kinds of changes were made to each file in each commit (e.g. M
= modified, R
= renamed).– Jan Krüger
Mar 25 at 15:39
I don't think there's a great solution for this because Git doesn't really move forwards in history like you describe, but I can recommend the flag
--name-status
for git log
(and others) which shows you what kinds of changes were made to each file in each commit (e.g. M
= modified, R
= renamed).– Jan Krüger
Mar 25 at 15:39
@JanKrüger, nice! A
git log --oneline --name-status
without a pathspec is a pretty good candidate for grepping through and looking for renames.– ArjunShankar
Mar 26 at 10:53
@JanKrüger, nice! A
git log --oneline --name-status
without a pathspec is a pretty good candidate for grepping through and looking for renames.– ArjunShankar
Mar 26 at 10:53
add a comment |
1 Answer
1
active
oldest
votes
Unfortunately, git log
itself strictly works backwards, as Git always does. Git literally cannot work forwards because what Git has stored is backwards: each commit remembers the hash ID of its parent commit, but since all commits are frozen in time the moment they are created, they cannot remember the hash IDs of their children, who are created later.
What git log
(and its sort of big sister / workhorse plumbing command git rev-list
) can do is do this reverse traversal once, figuring out which commits go before which other commits, then print in reverse. The git log --reverse
command does this. But alas, rename detection happens only during the backwards (which to Git is forwards) traversal and cannot be wedged into the later forwards (which to Git is backwards) printout.
It's not built in to Git, but you can use git rev-list
to do the reversal, save the result, then do your own forwards walk while running git diff --name-status
on each commit pair, looking for rename operations. Note that this is still a bit tricky since now branches really branch and merges really merge—in Git's internal backwards traversals, merges branch, while branches merge. :-) That is, suppose we have:
tag:abc
|
v
...--o--o--*--o--o--o <-- tip1
o--*--o----o <-- tip2
You want to start from tag abc
, which is on the left, and "work forwards". Git wants to start from either tip1
, the commit towards the right along the top line, or tip2
, the commit towards the right on the bottom line.
The commits marked *
rename your file A
to some new name. In the one along the top the new name is B
and in the one along the bottom the new name is C
.
If you start Git at tip2
, you must look for C
. Git notices the rename in *
and from then on, towards the left, looks for A
. If you start Git at tip1
, you must look for B
, in the same fashion.
If you've built a "forwards" listing by going backwards from tip1
to some point before tag abc
, you'll be OK: there's no branch in that listing since none of the commits leading to tip2
are included. But then suppose someone adds a merge to tip1
, and another commit:
tag:abc
|
v
...--o--o--*--o--o--o--M--o <-- tip1
/
o--*--o----o <-- tip2
Now the path from abc
to tip1
includes both renames. If you start at tip1
you must give git log --follow
the name that whoever did the merge chose to keep, whether that's B
or C
. Because git log -- B
or git log -- C
(whichever is the right name) does history simplification, Git is going to walk only one of the two legs behind M
–either the top or bottom row, depending on which one has the matching file—and when you work forwards from abc
you'll have to pick one of the two branches to work along, or do something fancy so that you know to check for A
-becomes-B
along the top while also checking for A
-becomes-C
along the bottom. (Git doesn't do anything fancy.)
Thank you. Today, I learned something about git.
– ArjunShankar
Mar 26 at 10:46
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55339525%2fhow-to-log-the-entire-git-history-of-a-file-that-is-renamed-moved-using-its-old%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Unfortunately, git log
itself strictly works backwards, as Git always does. Git literally cannot work forwards because what Git has stored is backwards: each commit remembers the hash ID of its parent commit, but since all commits are frozen in time the moment they are created, they cannot remember the hash IDs of their children, who are created later.
What git log
(and its sort of big sister / workhorse plumbing command git rev-list
) can do is do this reverse traversal once, figuring out which commits go before which other commits, then print in reverse. The git log --reverse
command does this. But alas, rename detection happens only during the backwards (which to Git is forwards) traversal and cannot be wedged into the later forwards (which to Git is backwards) printout.
It's not built in to Git, but you can use git rev-list
to do the reversal, save the result, then do your own forwards walk while running git diff --name-status
on each commit pair, looking for rename operations. Note that this is still a bit tricky since now branches really branch and merges really merge—in Git's internal backwards traversals, merges branch, while branches merge. :-) That is, suppose we have:
tag:abc
|
v
...--o--o--*--o--o--o <-- tip1
o--*--o----o <-- tip2
You want to start from tag abc
, which is on the left, and "work forwards". Git wants to start from either tip1
, the commit towards the right along the top line, or tip2
, the commit towards the right on the bottom line.
The commits marked *
rename your file A
to some new name. In the one along the top the new name is B
and in the one along the bottom the new name is C
.
If you start Git at tip2
, you must look for C
. Git notices the rename in *
and from then on, towards the left, looks for A
. If you start Git at tip1
, you must look for B
, in the same fashion.
If you've built a "forwards" listing by going backwards from tip1
to some point before tag abc
, you'll be OK: there's no branch in that listing since none of the commits leading to tip2
are included. But then suppose someone adds a merge to tip1
, and another commit:
tag:abc
|
v
...--o--o--*--o--o--o--M--o <-- tip1
/
o--*--o----o <-- tip2
Now the path from abc
to tip1
includes both renames. If you start at tip1
you must give git log --follow
the name that whoever did the merge chose to keep, whether that's B
or C
. Because git log -- B
or git log -- C
(whichever is the right name) does history simplification, Git is going to walk only one of the two legs behind M
–either the top or bottom row, depending on which one has the matching file—and when you work forwards from abc
you'll have to pick one of the two branches to work along, or do something fancy so that you know to check for A
-becomes-B
along the top while also checking for A
-becomes-C
along the bottom. (Git doesn't do anything fancy.)
Thank you. Today, I learned something about git.
– ArjunShankar
Mar 26 at 10:46
add a comment |
Unfortunately, git log
itself strictly works backwards, as Git always does. Git literally cannot work forwards because what Git has stored is backwards: each commit remembers the hash ID of its parent commit, but since all commits are frozen in time the moment they are created, they cannot remember the hash IDs of their children, who are created later.
What git log
(and its sort of big sister / workhorse plumbing command git rev-list
) can do is do this reverse traversal once, figuring out which commits go before which other commits, then print in reverse. The git log --reverse
command does this. But alas, rename detection happens only during the backwards (which to Git is forwards) traversal and cannot be wedged into the later forwards (which to Git is backwards) printout.
It's not built in to Git, but you can use git rev-list
to do the reversal, save the result, then do your own forwards walk while running git diff --name-status
on each commit pair, looking for rename operations. Note that this is still a bit tricky since now branches really branch and merges really merge—in Git's internal backwards traversals, merges branch, while branches merge. :-) That is, suppose we have:
tag:abc
|
v
...--o--o--*--o--o--o <-- tip1
o--*--o----o <-- tip2
You want to start from tag abc
, which is on the left, and "work forwards". Git wants to start from either tip1
, the commit towards the right along the top line, or tip2
, the commit towards the right on the bottom line.
The commits marked *
rename your file A
to some new name. In the one along the top the new name is B
and in the one along the bottom the new name is C
.
If you start Git at tip2
, you must look for C
. Git notices the rename in *
and from then on, towards the left, looks for A
. If you start Git at tip1
, you must look for B
, in the same fashion.
If you've built a "forwards" listing by going backwards from tip1
to some point before tag abc
, you'll be OK: there's no branch in that listing since none of the commits leading to tip2
are included. But then suppose someone adds a merge to tip1
, and another commit:
tag:abc
|
v
...--o--o--*--o--o--o--M--o <-- tip1
/
o--*--o----o <-- tip2
Now the path from abc
to tip1
includes both renames. If you start at tip1
you must give git log --follow
the name that whoever did the merge chose to keep, whether that's B
or C
. Because git log -- B
or git log -- C
(whichever is the right name) does history simplification, Git is going to walk only one of the two legs behind M
–either the top or bottom row, depending on which one has the matching file—and when you work forwards from abc
you'll have to pick one of the two branches to work along, or do something fancy so that you know to check for A
-becomes-B
along the top while also checking for A
-becomes-C
along the bottom. (Git doesn't do anything fancy.)
Thank you. Today, I learned something about git.
– ArjunShankar
Mar 26 at 10:46
add a comment |
Unfortunately, git log
itself strictly works backwards, as Git always does. Git literally cannot work forwards because what Git has stored is backwards: each commit remembers the hash ID of its parent commit, but since all commits are frozen in time the moment they are created, they cannot remember the hash IDs of their children, who are created later.
What git log
(and its sort of big sister / workhorse plumbing command git rev-list
) can do is do this reverse traversal once, figuring out which commits go before which other commits, then print in reverse. The git log --reverse
command does this. But alas, rename detection happens only during the backwards (which to Git is forwards) traversal and cannot be wedged into the later forwards (which to Git is backwards) printout.
It's not built in to Git, but you can use git rev-list
to do the reversal, save the result, then do your own forwards walk while running git diff --name-status
on each commit pair, looking for rename operations. Note that this is still a bit tricky since now branches really branch and merges really merge—in Git's internal backwards traversals, merges branch, while branches merge. :-) That is, suppose we have:
tag:abc
|
v
...--o--o--*--o--o--o <-- tip1
o--*--o----o <-- tip2
You want to start from tag abc
, which is on the left, and "work forwards". Git wants to start from either tip1
, the commit towards the right along the top line, or tip2
, the commit towards the right on the bottom line.
The commits marked *
rename your file A
to some new name. In the one along the top the new name is B
and in the one along the bottom the new name is C
.
If you start Git at tip2
, you must look for C
. Git notices the rename in *
and from then on, towards the left, looks for A
. If you start Git at tip1
, you must look for B
, in the same fashion.
If you've built a "forwards" listing by going backwards from tip1
to some point before tag abc
, you'll be OK: there's no branch in that listing since none of the commits leading to tip2
are included. But then suppose someone adds a merge to tip1
, and another commit:
tag:abc
|
v
...--o--o--*--o--o--o--M--o <-- tip1
/
o--*--o----o <-- tip2
Now the path from abc
to tip1
includes both renames. If you start at tip1
you must give git log --follow
the name that whoever did the merge chose to keep, whether that's B
or C
. Because git log -- B
or git log -- C
(whichever is the right name) does history simplification, Git is going to walk only one of the two legs behind M
–either the top or bottom row, depending on which one has the matching file—and when you work forwards from abc
you'll have to pick one of the two branches to work along, or do something fancy so that you know to check for A
-becomes-B
along the top while also checking for A
-becomes-C
along the bottom. (Git doesn't do anything fancy.)
Unfortunately, git log
itself strictly works backwards, as Git always does. Git literally cannot work forwards because what Git has stored is backwards: each commit remembers the hash ID of its parent commit, but since all commits are frozen in time the moment they are created, they cannot remember the hash IDs of their children, who are created later.
What git log
(and its sort of big sister / workhorse plumbing command git rev-list
) can do is do this reverse traversal once, figuring out which commits go before which other commits, then print in reverse. The git log --reverse
command does this. But alas, rename detection happens only during the backwards (which to Git is forwards) traversal and cannot be wedged into the later forwards (which to Git is backwards) printout.
It's not built in to Git, but you can use git rev-list
to do the reversal, save the result, then do your own forwards walk while running git diff --name-status
on each commit pair, looking for rename operations. Note that this is still a bit tricky since now branches really branch and merges really merge—in Git's internal backwards traversals, merges branch, while branches merge. :-) That is, suppose we have:
tag:abc
|
v
...--o--o--*--o--o--o <-- tip1
o--*--o----o <-- tip2
You want to start from tag abc
, which is on the left, and "work forwards". Git wants to start from either tip1
, the commit towards the right along the top line, or tip2
, the commit towards the right on the bottom line.
The commits marked *
rename your file A
to some new name. In the one along the top the new name is B
and in the one along the bottom the new name is C
.
If you start Git at tip2
, you must look for C
. Git notices the rename in *
and from then on, towards the left, looks for A
. If you start Git at tip1
, you must look for B
, in the same fashion.
If you've built a "forwards" listing by going backwards from tip1
to some point before tag abc
, you'll be OK: there's no branch in that listing since none of the commits leading to tip2
are included. But then suppose someone adds a merge to tip1
, and another commit:
tag:abc
|
v
...--o--o--*--o--o--o--M--o <-- tip1
/
o--*--o----o <-- tip2
Now the path from abc
to tip1
includes both renames. If you start at tip1
you must give git log --follow
the name that whoever did the merge chose to keep, whether that's B
or C
. Because git log -- B
or git log -- C
(whichever is the right name) does history simplification, Git is going to walk only one of the two legs behind M
–either the top or bottom row, depending on which one has the matching file—and when you work forwards from abc
you'll have to pick one of the two branches to work along, or do something fancy so that you know to check for A
-becomes-B
along the top while also checking for A
-becomes-C
along the bottom. (Git doesn't do anything fancy.)
edited Mar 26 at 15:58
answered Mar 25 at 15:42
torektorek
212k21 gold badges270 silver badges356 bronze badges
212k21 gold badges270 silver badges356 bronze badges
Thank you. Today, I learned something about git.
– ArjunShankar
Mar 26 at 10:46
add a comment |
Thank you. Today, I learned something about git.
– ArjunShankar
Mar 26 at 10:46
Thank you. Today, I learned something about git.
– ArjunShankar
Mar 26 at 10:46
Thank you. Today, I learned something about git.
– ArjunShankar
Mar 26 at 10:46
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55339525%2fhow-to-log-the-entire-git-history-of-a-file-that-is-renamed-moved-using-its-old%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
You can't always trace every move/rename operation, because sometimes Git can't figure it out. Not an answer, but the best bet is to avoid moving/renaming files in Git, if you can manage that.
– Tim Biegeleisen
Mar 25 at 14:01
1
I don't think there's a great solution for this because Git doesn't really move forwards in history like you describe, but I can recommend the flag
--name-status
forgit log
(and others) which shows you what kinds of changes were made to each file in each commit (e.g.M
= modified,R
= renamed).– Jan Krüger
Mar 25 at 15:39
@JanKrüger, nice! A
git log --oneline --name-status
without a pathspec is a pretty good candidate for grepping through and looking for renames.– ArjunShankar
Mar 26 at 10:53