News for hackers. Stuff that matters.
Re:How to teach Git by war1025 on Wednesday January 16, 2019 @12:16PM (#18922647)
`git log -p` is my favorite obscure git command. Shows you commit by commit changes. If you specify a path, it limits to only those files. If you do a single file you can do `git log -p --follow <file_path>` and it will track the file across moves and renames.

Also `git whatchanged` is a super helpful command to see just the list of files that changed in each commit

Re:How to teach Git by LyndsySimon on Thursday January 17, 2019 @03:32PM (#18934338)
`git add -p` is also very, very useful. I use it all the time, to the point that I've aliased it to `a`.

If you're interested, here's my .gitconfig, including all of my aliases: https://gitlab.com/lyndsysimon/dotfiles/blob/master/git/gitc...

Re:How to teach Git by war1025 on Thursday January 17, 2019 @04:17PM (#18934723)
Completely agree. I think a lot of people would enjoy git more if they made better use of the `-p` options.
Re:How to teach Git by tome on Friday January 18, 2019 @09:19AM (#18939420)
Do you know about `git commit -p`? You might like it even more than `git add -p`.
Re:How to teach Git by rachelmcarmena on Wednesday January 16, 2019 @05:05PM (#18925923)
I didn't know "whatchanged", thanks! However, look at the description: https://git-scm.com/docs/git-whatchanged
Re:How to teach Git by war1025 on Wednesday January 16, 2019 @05:44PM (#18926265)
Yea. It's technically deprecated, but it is also super useful so I don't see any reason not to use it.
Re:How to teach Git by tome on Friday January 18, 2019 @09:20AM (#18939433)
Yikes, do people consider `git log -p` obscure? I can't live without it!