如何在shell中获取SVN头版本号? [英] how can I get the SVN head version number in shell?

查看:51
本文介绍了如何在shell中获取SVN头版本号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在命令行中使用 svn.如何在命令行中获取头部版本号.我需要号码,不仅是为了查看信息.我想用这个数字自动构建我的项目.

I use svn in command line. How can I get the head version number in command line. I need the number,not only to see the info . I want to use this number to build my project automatic.

推荐答案

这里有简单的 shell 脚本.执行:svn info -rHEAD |grep 修订 |cut -d' ' -f2

Here is simple shell script thingy for you. Execute: svn info -rHEAD | grep Revision | cut -d' ' -f2

查看实际操作:

main$ svn info -rHEAD
Path: main
URL: svn://url/trunk/main
Repository Root: svn://url
Repository UUID: xxxxx-xxxx-xxxx-xxxx-xxxxxxxx
Revision: 17042
Node Kind: directory
Last Changed Author: Nishant
Last Changed Rev: 17040
Last Changed Date: 2012-08-09 11:29:05 +0530 (Thu, 09 Aug 2012)

main$ svn info -rHEAD | grep Revision | cut -d' ' -f2
17042

Edit1:更新为获取头部转速.

这篇关于如何在shell中获取SVN头版本号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆