Tuesday, February 25, 2014

[OSDI] SVN (Version Control)

使用Git之後,再返回來使用SVN,以下是我的筆記。

Difference between Git

"Git is Distributed Source Control", but SVN is not.

Start Here

In SVN, we have to:
  1. create a new empty SVN repo
  2. find our project directory and import it to the repo
  3. checkout the code in the other places
Then, we can start using basic SVN commands after the 3 steps.

Suppose:
  • Repo directory: /User/heron/Downloads/svn_test
  • Project directory: /User/heron/Downloads/project
  • Checkout directory: /User/heron/Download/test
  • you may have to replace your own directory path

create a new empty SVN repo

  • mkdir /User/heron/Downloads/svn_test
  • cd /User/heron/Downloads/svn_test
  • svnadmin create .

find our project directory and import it to the repo

  • svn import /User/heron/Downloads/project file:///Users/heron/Downloads/svn_test -m "init import"
    • -m: following the content of the commit

checkout the code in the other places

  • cd /User/heron/Download/test
  • svn checkout file:///Users/heron/Downloads/svn_test

start using basic SVN commands

  • svn log
    • read commit logs
  • svn diff
    • review the changes from the last commit
  • svn commit
    • similar to "git commit" and "git push"
    • commit current project
    • ex. svn commit -m "the second commit"
  • svn update
    • similar to "git pull"

More Reference

No comments:

Post a Comment