- Login to 10.15.1.31 server with "repouser" credentials. ( userid: repouser , passwd: repouser123)
- Create the directory ( .git) in the requested path inside the server mirror.
- To create a directory, enter the following commands at the command prompt.
cd /home/repouser/gitrepos/[simt-mirror] or [borqs-mirror]based on the request to the requested path/
Example: cd /home/repouser/gitrepos/simt_mirror/platform/vendor
mkdir <empty-repo-name-requested.git>
Example: mkdir NetworkSelection.git
- Initialize the bare git repo.
git init --bare ./<empty-repo-name-requested.git>/
Example: git init --bare ./NetworkSelection.git/
- Create a gerrit link via the gerrit account (service account). Login to 10.15.1.31 server with "gerrit" credentials.
cd /home/gerrit/gerrit-home/git
ln -s <git path inside mirror> <Reference that must appear in gerrit> Example: ln -s /home/repouser/gitrepos/simt_mirror/platform/vendor/sonim/NetworkSelection.git simt_mirror/platform/vendor/sonim/NetworkSelection.git
- Restart the gerrit services.
cd ~/gerrit-home/git.
~/gerrit-home/bin/gerrit.sh restart
Output 1: Stopping Gerrit Code Review: OK
Output 2: Starting Gerrit Code Review: OK
- Login with your user id in a new window, to have a branch requested for this repo, for example: 8926-X700-10152-BELL-MR1-MSI1.
mkdir create_branch_for_<git repo/project name>
Example : mkdir create_branch_for_NetworkSelection
- Clone the project ( empty repo) in your directory in your home directory.
git clone repouser@10.15.1.31:/home/repouser/gitrepos/<mirror>/<path> .
git clone repouser@10.15.1.31:/home/repouser/gitrepos/simt_mirror/platform/vendor/sonim/NetworkSelection
- Set the branch inside the new project.
cd <cloned directory> <pre> Example : cd NetworkSelection
- Set the branch to the requested branch.
git checkout -b <new-branch-requested for empty git repo>
Example: git checkout -b 8926-X700-10152-BELL-MR1-MSI1
- Touch a readme file in the directory.
touch Readme.txt
- Add the newly added file.
git add Readme.txt
- commit the Readme file.
git commit -am "Committed readme.txt file
- Run git status and git log to see if your commits are proper and visible.
- To get the remote repo info run git remote -v being inside the NetworkSelection cloned directory.
git remote -v
- Push the commit to the empty repo on the requested branch.
git push <remote repo> <requested branch>
Example : git push origin 8926-X700-10152-BELL-MR1-MSI1
- Note: <remote repo> is the output of the command git remote -v.
- Add entry to the manifest file. To make an entry to the manifest file for the new repo, create a workspace using your id.
repo init -u repouser@10.15.1.31:/home/repouser/gitrepos/<mirror-name or path>/platform/manifest -b <repo branch>
repo Example: init -u repouser@10.15.1.31:/home/repouser/gitrepos/simt_mirror/platform/manifest -b 8926-X700-10152-BELL-MR1-MSI1
cd to the .repo/manifests directory and set the branch.
cd .repo/manifests
git checkout <branch on which new repo was created>
Example: git checkout 8926-X700-10152-BELL-MR1-MSI1
- Edit the default.xml file and create an entry where similar directory structures are present for the new repo, using the vi editor. For example, to add an entry for repo * SonimSetupWizard under platform/vendor/sonim/, use the following entries. Search for entries that are present, based on the directory paths mentioned and add * accordingly. Save the changes in the vi editor.
vi default.xml
"<project name="platform/vendor/sonim/SonimSetupWizard" path="vendor/sonim/SonimSetupWizard"/>
- Commit changes to local repository.
git commit -am "Added new empty repo <repo-name> to branch <branch-name>
Example: git commit -am "Added new empty repo SonimSetupWizard to branch 8926-X700-10152-BELL-MR1-MSI1
Push the manifest branch to remote repository
git push origin <branch_name>
Example: git push origin 8926-X700-10152-BELL-MR1-MSI1
- Verify that the newly created empty git repo on the requested branch is properly created, using following steps:
Login to your user account and test if the repo sync of the new project completes successfully.
Example line1: mkdir test
Example line2: cd test/
repo init -u ssh://username@10.15.1.31:29418/simt_mirror/platform/manifest -b <branch-name>
Example : repo init -u ssh://username@10.15.1.31:29418/simt_mirror/platform/manifest -b 8926-X700-10152-BELL-MR1-MSI1
repo sync "newly created repo/project"
Example: repo sync "platform/vendor/sonim/NetworkSelection"