==== CVS ====
To install the cvs and subversion
# sudo apt-get install cvs subversion
To set the root of cvs
# mkdir devserver
# CVSROOT=/devserver
# export CVSROOT
next init the cvs and have root created by itself
# cvs init
# cd devserver
/devserver # ls
CVSROOT
I checkout the CVSROOT
# cvs co CVSROOT
when I added some files and want to check in, I have a problem:root is not allowed to commit files to the system.
I created a new user: vic
I login as Vic created a folder called myfolders, and create 4 files: 1, 2, 3 and 4 under that folder.
cvs ci myfolders
This will commit myfolders to the CVSROOT
==== Subversion ====
I installed subversion with the previous command.
to create "root" of the server
svnadmin /devserver/svn
After the folder is created, we can start using the svn.
To create/commit a project
svn import /myfolder/essay/ file:///devserver/svn/myfolder
checkout
svn co file:///devserver/svn/myfolder
==== Git ====
install git
apt-get install git-core
configure identity and email
root@cherry:/home/vic# git config --global user.name "Vic"
root@cherry:/home/vic# git config --global user.email vic.ding@os3.nl
define the editor, I do think introduction to VI is important.
git config --global core.editor vim
tool to handle(show) conflicts.
git config --global merge.tool vimdiff
init the empty space for use
root@cherry:/home/vic# git init
Initialized empty Git repository in /home/vic/.git/
Create files and add/commit to git
root@cherry:/home/vic# touch 1 2 3 4
root@cherry:/home/vic# ls
1 2 3 4 Maildir
### now committing ###
root@cherry:/home/vic# git add 1 2 3 4
root@cherry:/home/vic# git commit -m 'init push'
[master (root-commit) 019975b] init push
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 1
create mode 100644 2
create mode 100644 3
create mode 100644 4
My first commit
# edit the file a bit
root@cherry:/home/vic# nano 1
#put file 1 into staging
root@cherry:/home/vic# git add 1
#commit
root@cherry:/home/vic# git commit
# On branch master
# Changed but not updated:
# (use "git add ..." to update what will be committed)
# (use "git checkout -- ..." to discard changes in working directory)
#
# modified: 1
#
# Untracked files:
# (use "git add ..." to include in what will be committed)
#
# .bash_history
# .bash_logout
# .bashrc
# .profile
# Maildir/
no changes added to commit (use "git add" and/or "git commit -a")
root@cherry:/home/vic# git add 1
root@cherry:/home/vic# git commit
[master d0b1bf7] first commit
1 files changed, 1 insertions(+), 0 deletions(-)
=== workable but annoying ===
vic@cherry:~$ git status
# On branch master
# Untracked files:
# (use "git add ..." to include in what will be committed)
#
# .bash_history
# .bash_logout
# .bashrc
# .profile
# Maildir/
nothing added to commit but untracked files present (use "git add" to track)
So I have to make an "ignore file"
nano .gitignore
#content of the .gitignore
.gitignore
.bash_history
.bash_logout
.bashrc
.profile
Maildir/
Now it is much peaceful
vic@cherry:~$ git status
# On branch master
nothing to commit (working directory clean)
=== work with existing project ===
to clone an existing repository
git clone git://android.git.kernel.org/platform/manifest.git
This will clone the Android repository