This example walks you through the entire process of creating a repository, cloning it, populating it with content, pushing,
and finally mapping one of its branches to an
AccuRev stream, all through
Git, Gerrit, and
GitCentric CLI commands.
-
Create a repository with an initial empty commit:
ssh -p 29418 yourUsername@yourServer gerrit create-project --empty-commit repoName
-
Register the repo with
GitCentric and associate it with an
AccuRev Server:
ssh -p 29418 yourUsername@yourServer gitcentric config-repo repoName
-S 10.0.0.182:5050 -u syncUser -p syncUserPassword
-
Clone the repo.
git clone ssh://yourUsername@yourServer:29418/repoName repoName
-
Change to the new clone’s directory and configure it:
cd repo_tues2
git config user.name "Firstname Lastname"
git config user.email "f.lastname@yourdomain.com"
git config remote.origin.push refs/heads/*:refs/for/*
-
Using your preferred text editor, create a file in the clone.
-
Add, commit, and push the file:
git add --all
git commit --all -m"First commit"
git push
Note: This step creates branch
master, which must exist before the next step.
-
Map the
master branch to a stream named
agc_devel on the
AccuRev Server:
ssh -p 29418 yourUsername@yourServer gitcentric config-branch repoName
-b master -s streamName -e /
-
Display a listing showing the mapped repo:
ssh -p 29418 yourUsername@yourServer gitcentric ls-repo