How do I see the last 10 commits in reverse-chronological order with SVN?

98,048

Solution 1

svn log --limit 10

or

svn log -l 10

Further googling uncovered the answer. svn log lists in reverse-chronological order by default.

Solution 2

To clarify the previous answers - note that svn log by default only shows the commits up to the revision of your working copy (latest svn update, run svn info to see). So yes, if it's OK for you to download all commits first, this combination will work:

svn update

svn log -l 10

However, I'm mostly interested in showing the ALL latest commits without first updating my working copy, so I mostly compare my log to HEAD falling:

svn log -l 10 -r HEAD:1

It makes a huge difference to me.

Solution 3

A shortcut -l exists for --limit

# show last 10 logs
svn log -l 10

Solution 4

To see them in chronological order:

svn log -r1:HEAD
Share:
98,048
Lokesh Dhakar
Author by

Lokesh Dhakar

Working on Design Systems at Square. Prev web lead at Getaround. Open source projects: Lightbox and Color Thief.

Updated on July 08, 2022

Comments

  • Lokesh Dhakar
    Lokesh Dhakar almost 2 years

    Using the SVN command line, is there a way to show the last X number of commits along with commit messages, in reverse-chronological order (newest commit first)?

  • user229044
    user229044 about 14 years
    SVN has really useful built-in help. svn help log would probably be even faster than a Google search.
  • Shyam K
    Shyam K over 11 years
    This command seems to return only the last but one(not the latest) commit messages. For eg the latest commit is r901 but it returns only till r900. Just wanted to check if this was the standard or an error. Also svn log -l10 <URL of your repository> would return the latest(r901) also.
  • Owl
    Owl over 3 years
    This is the correct answer, the other answers don't show my latest commits.
  • Owl
    Owl over 3 years
    This isn't the right answer, this wont show the latest commits, and that could be very misleading.
  • Owl
    Owl over 3 years
    It doesn't though. yegor256's answer is the correct one.
  • Owl
    Owl over 3 years
    The -r HEAD:1 is key.