git blame
Displays the
author and last commit information
for each line in a file, helping track the origin of changes. Create a file and add some content:
echo "Line 1" > myfile.txt
echo "Line 2" >> myfile.txt
echo "Line 3" >> myfile.txt
Add and commit the file:
git add myfile.txt
git commit -m "Initial commit"
Make changes to the file and commit them
Make changes to the file and commit them
git blame myfile.txt
02fa3e76 (Luka 2023-06-01 20:07:40 +0400 1) Line 1
02fa3e76 (Luka 2023-06-01 20:07:40 +0400 2) Line 2
02fa3e76 (Luka 2023-06-01 20:07:40 +0400 3) Line 3
91354ada (Luka 2023-06-01 20:08:10 +0400 4) Line 4
91354ada (Luka 2023-06-01 20:08:10 +0400 5) Line 4
7ba66ba6 (Luka 2023-06-01 20:08:23 +0400 6) Line 5
by Luka Tatarishvili
12 months ago
Git
commands
3
Pro tip: use ```triple backticks around text``` to write in code fences