-
Move file, with history, to a new repo (StackOverflow: Move files between Git repos preserving history):
git log --pretty=email --patch-with-stat --reverse --binary -- path/to/file_or_folder | (cd /path/to/new_repository && git am)
-
StackOverflow: Get the last commit hash from a remote repo without cloning.
# Get last commit for default branch: git ls-remote <url> HEAD | awk '{print $1}' # Get short last commit for branch: git ls-remote <url> refs/heads/<branch> | awk '{print $1}' | cut -c 1-7 -
-
StackOVerflow: How to blame a deleted file in git?.
git log -2 --oneline -- /path/to/file
-
LiveJournal:
git log --grep
examples - for historical commit message searching. -
Get files/folders from git repo without checking out:
- Git: archive.
git archive -v --format=<zip|tar> -o <output_file> --remote=<repo> <ref> <file/folder>
<br />
for newlines in Github markdown tables.