I'm about to move a ton of files around in an existing project. Before I do this, I'd like to have a firm grasp on some techniques used to analyze code that has a multi-file history.
How can I use git to ask: "where did this line of code come from?" when the content has moved through multiple files in it's life time?
I know git doesn't...
I can't quite figure out how to see what exactly was changed, in the remote repository, by a 'push'. 'git log' shows me the series of commits but those took place in my local repository and were pushed at different times; I would like to know which commits were part of each specific 'push'
...
I need to write a script that incrementally keeps track of files and directories added and removed from a git repo.
I have tried to use:
git log -n1 --pretty="format:" --name-only
But that only tells me which files were committed. It does not specify if it was added or removed.
Any ideas?
...
It appears to insert less blank lines the closer I type the command to the bottom of the terminal window. If I type it at the top of the terminal window, it inserts nearly a full window height of blank lines; if I type it at the very bottom, no blank lines are inserted.
It seems like the pager program is pushing output to the bottom ...
Background: this question. git apply <patchfile> just recreates the file but without committing the history, which in this case would be desireable. Is there any switch for git-apply to do so? Or is there a way to convert the patchfile into a git-am compatible file? (Currently, git-am complains "Patch format detection failed")
...
I've got a file that's been installed on my system that is known to be part of a git repo. I'd like to find out which commit(s) (re-)introduced that version of that file, ie which commit is responsible for putting the file in its current state.
I know that the file is in the repo because git show $(git hash-object $the_file) works.
At...