Requirements:
- svn
- a simple project in a directory (folder)
Let's say you have a quick idea about a certain research topic, and you start writing code to test your ideas. A week later, you realize that you have a full-blown project on hand. You have about five things going on, and takes hours to create a multi-gigabyte artifact files - you don't dare move these around, but you still want to version some of the core modules that you have created for your analysis. You understand the virtues of versioning your source codes and documentations - it'll save you hours if you ever run into problems and have to back track what you have done with your code. Here is a way to convert your project to be versioned, using SVN as your version control system.
Instruction:
Create the repository directory:
mkdir ~/svn-reposThen populate the directory with svn files
svnadmin create ~/svn-reposGo to your project directory, with all the files used for the project (this assumes it is all in one giant mess of a directory).
cd ~/Desktop/snowball.project/
say you have these files in the snowball.project directory:
- ginormous1.data
- ginormous2.data
- documentation.txt
- projectmodule1.py
So, you create a temporary directory:
mkdir tempThen you import the content of that directory:
cp documentation.txt temp/
cp projectmodule1.py temp/
cd temp/Then you can check out the files, in a separate directory:
svn import . file:///Users/steve/svn-repos/snowball/trunk/
mkdir temp2you should see .svn when you:
cd temp2
svn checkout file:///Users/steve/svn-repos/snowball/trunk/
cd trunk
ls -aalong with the critical files.
Move .svn directory snowball.project:
mv -rf .svn ~/Desktop/snowball.project/
Conclusion:
This converts snowball.project into SVN compatible directory. Command such as svn update and svn commit should now work when you are in the original directory. You may erase temp and temp2 directory now.
No comments:
Post a Comment