Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 3, 2023. It is now read-only.

git log name status

Robert N. edited this page Jun 21, 2015 · 1 revision

Getting a list of files that changed between each commit of your current branch

  • Walking the current tree: HEAD1 vs. HEAD, HEAD2 vs HEAD~1, and so on

Git Version:

git log --name-status --pretty=oneline

libGit2Sharp Version:

var repo = new LibGit2Sharp.Repository ("/your/repo/path");
foreach (Commit commit in repo.Commits) {
    foreach (var parent in commit.Parents) {
        Console.WriteLine ("{0} | {1}", commit.Sha, commit.MessageShort);
        foreach (TreeEntryChanges change in repo.Diff.Compare<TreeChanges>(parent.Tree,
        commit.Tree)) {
            Console.WriteLine ("{0} : {1}", change.Status, change.Path);
        }
    }
}

Sample Output:

1d9d4bb881f97f5d3b67741a893f238e7221e2b1 | Updated readme with fork info
Modified : README.md
58cc5c41963d5ff68556476158c9c0c2499e061c | Update Makefile for PE32+ (platform:x64) assemblies
Modified : Makefile
Modified : README.md
a7823c1c0a737c5218d33691f98828c78d52130b | Fix Makefile for 64-bit native lib and add README.md
Modified : Makefile
Added : README.md
ea7e6722f67569cb9d7a433ff2c036fc630d8561 | Update solution files.
Modified : mono-curses.csproj
Modified : mono-curses.sln
05dbe6e18895d1037ce333b0a1f652eeae3f8b33 | Fix resize handling.
Modified : attrib.c
Modified : gui.cs

This is from my Stackoverflow answer

Clone this wiki locally

Morty Proxy This is a proxified and sanitized view of the page, visit original site.