---
title: "SVN - 获得最新的更新目录"
author: "飞奔的熊猫"
date: "2015-01-12T15:32:46Z"
tags: []
categories: ["开源软件"]
slug: "svn"
draft: false
lastmod: "2015-01-13T10:14:23Z"
id: 2175054
url: "https://runpanda.iteye.com/blog/2175054"
---

【基本介绍】
想或者指定的svn tag路径下面最新的版本文件，然后就可以执行下载等其他后续操作。

【解决方案】
svn log可以打印出所有的更新信息，版本，作者，时间等
svn log -v 可以更加详细的打印出，更新了哪些文件等

这样就可以直接获得最后更新的文件路径及版本文件。

```linux

svn log -v svn://server | awk '/^   A/ { print $2 }' | grep -v RC |  head -1

```



```linux

[root@xx ~]# svn log -v svn://servers/tags | awk '/^   A/ { print $2 }' | grep -v RC |  head -10
/tags/testing3
/tags/testing2
/tags/testing1


```


【参考引用】
<http://stackoverflow.com/questions/5244261/find-the-latest-svn-tag>