I'm primarily a Git user, but have a client who's using Subversion. What are the *very* basics I need to know?
I used to use subversion, but it's been a few years. I've been using (and now love) Git.
But I have a client now that uses s开发者_JAVA百科ubversion so I need to brush up on my svn chops.
What are the 3-4 most critical things I need to know to:
- Get a working copy
- Edit files
- Pull down updates
- Push up changes and additions
Since you already know GIT, you might be interested in :
- https://git.wiki.kernel.org/index.php/GitSvnComparison
And the following also provides an information that relates to git knowledge
- http://git.or.cz/course/svn.html
In short, most basic version control approach are similar.
Creating a repository. : svnadmin create /path/to/repos
Checking out a repository or folder: svn co http://hostname/path/to/repos
Adding, deleting, moving files
svn add filename/directory-name
svn rm filename/directory-name
Committing changes : svn commit –m “Message Goes Here”
Checking the status of files:
svn status
svn diff file ... > patch
Getting information about a repository: svn info
Applying and trying your patch: patch -p0 --dry-run -i <patch or diff file>
Updating repo: svn update or svn update -r revision
Some other useful details:
Reverting a commit : svn --revision (version to revert):(version below it) .
Creating a branch
1. svn co url/to/trunk trunk
2. svn cp url/to/branch -m "Branching from trunk"
3. svn switch url/to/branch .
- svn co
- edit them however you like.
- svn update (jn the directory you want to update)
- svn ci (in the directory you want to commit).
The workflow is pretty much like git, except there's no "remote" vs "local" repo. There's just one repo, the one you've checked out from. Note you can do an export which will check out the repo without any .svn folders, so it's a "clean" checkout with no source control capabilities.
You might also want to check Howto use Git and svn together : http://flavio.castelli.name/howto_use_git_with_svn
精彩评论