What do you type to see a list of files that have changed in a svn repo?
I have a repo, and I want to run a standard test before updating t开发者_运维问答he source on a server, that it must first check if any of the files have changed. How can I see such a list?
Gives list of locally modified files:
svn st | grep "^M"
The typical way is to use svn status
and grep. Grep will return 0 if at least one line is found. For example:
Checking whether a file has been modified:
value=`svn status | grep -q "^M"`
Checking whether there is any change at all:
value=`svn status | grep -q "^[A-Z]"`
svn st
st is short for status.
If you want to check only the modified files.
svn st | grep M
To look only to the modified items respect to the last time you update the local version
svn status -q
if you want to look to the differences between the remote repository use -u
svn status -qu
The option -q
show only the modified / added / removed items
精彩评论