The CouchDB source code can be found in the Subversion repository, which can also be browsed online.
You can check out the code using the svn command:
svn co http://svn.apache.org/repos/asf/couchdb/trunk couchdb
Committers should use the secure repository:
svn co https://svn.apache.org/repos/asf/couchdb/trunk couchdb
Read more about version control at the Apache Software Foundation.
Read the README file for install instructions: CouchDB README