`
Gavin.Chen
  • 浏览: 322786 次
  • 性别: Icon_minigender_1
  • 来自: 广州
文章分类
社区版块
存档分类
最新评论

subversion common commands

阅读更多

1.svn help.
description: svn help subcommand will describe the syntax, options, and behavior of the command

$svn help import
import: commit an unversioned file or tree into the repository.
usage: import [PATH] URL
....


2. svn import
description: the svn import command is a quick way to copy an unversioned tree of files into a repository, creating intermediate directories as necessary.
$ svnadmin create /var/svn/newrepos
$ svn import mytree file:///var/svn/newrepos/some project -m "Initial import"


3. svn list
$ svn list file:///var/svn/repos
/trunk
/branches
/tags


4. svn checkout
description: most of the time, you will start using a Subversion repository by doing a checkout of your project, checking out a repository creates a "working copy" of it on your local machine.
$ svn checkout http://svn.collab.net/repos/svn/trunk
$ svn checkout -r 1729


5. svn update
description: using svn update to bring your working copy into sync with the latest revision in the repository
$ svn update
$ svn update -r 1729


6. svn add foo

7. svn delete foo

8. svn copy foo bar

9. svn move foo bar

10. svn mkdir blort

11. svn status
description: if you run status at the top of your working copy with no arguments, it will detect all file and tree changes you've made. if you pass a specific path to svn status, you get information about that item alone, svn status also has a --verbose(-v) option, which will show you the status of every item in your working copy, even if it has not been changed. there is the --show-update(-u)option, which contacts the repository and adds information about things that are out of date:

$ svn status stuff/fish.c
$ svn status -v
$ svn status -u -v


12. svn diff
description: another way to examine your changes is with the svn diff command, you can find out exactly how you've modified things by running svn diff with no arguments, which prints out file changes in unified diff format:
$ svn diff
$ svn diff > patchfile

13. svn revert README
description: suppose while viewing the output of svn diff you determine that all the changes you made to a particular file are mistakes. Maybe you shouldn't have changed the file at all, or perhaps it would be easier to make different changes starting from scratch.

$ svn revert README

14. svn commit -m "MESSAGE"
description: the svn commit command sends all of your changes to the repository.

15. svn resolve
description: now use svn resolve, and you're ready to commit your changes
$ svn resolve --accept working sandwich.txt
$ svn commit -m "MESSAGE"
$ svn commit -F logmsg

16. svn log

17. svn diff

18. svn cat

19. svn list

20. svn cleanup


21. creating a branch
$ svn copy http://svn.example.com/repos/calc/trunk http://svn.example.com/repos/calc/branches/my-calc-branch -m "Creating a private branch of /calc/trunk"

22. working with your branch
$ svn checkout http://svn.example.com/repos/calc/branches/my-calc-branch

23. merge your branches into trunk
$ pwd
/home/user/my-calc-branch

$ svn merge ^/trunk
--- Merging r345 through r356 into '.':
(that we're using the caret(^) syntax to avoid having to type out the entire /trunk URL.


24. mergeinfo and previews
$ cd my-calc-branch
$ svn propget svn:mergeinfo .
/trunk:341-390

$ svn mergeinfo ^/trunk
r341
r342
...
r388
r389


$ svn merge ^/trunk --dry-run

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics