User:Srilakshmi sonim/sandbox

Example : To Create a empty git repo NetworkSelection in simt mirror under the path platform/vendor/sonim/ on the branch 8926-X700-10152-BELL-MR1-MSI1
  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  Example: mkdir NetworkSelection.git

  Initialize the bare git repo. git init --bare .// 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  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

<li> Clone the project ( empty repo) in your directory in your home directory.</li> git clone repouser@10.15.1.31:/home/repouser/gitrepos/ /. git clone repouser@10.15.1.31:/home/repouser/gitrepos/simt_mirror/platform/vendor/sonim/NetworkSelection

<li> Set the branch inside the new project.</li> cd Example : cd NetworkSelection

<li>Set the branch to the requested branch.</li> git checkout -b <new-branch-requested for empty git repo> Example: git checkout -b 8926-X700-10152-BELL-MR1-MSI1

<li>Touch a readme file in the directory.</li> touch Readme.txt

<li>Add the newly added file.</li> git add Readme.txt

<li>commit the Readme file.</li> git commit -am "Committed readme.txt file

<li>Run git status and git log to see if your commits are proper and visible.</li>

<li>To get the remote repo info run git remote -v being inside the NetworkSelection cloned directory.</li> git remote -v

<li>Push the commit to the empty repo on the requested branch.</li> git push Example : git push origin 8926-X700-10152-BELL-MR1-MSI1
 * Note: is the output of the command git remote -v.

<li>Add entry to the manifest file. To make an entry to the manifest file for the new repo, create a workspace using your id.</li> repo init -u repouser@10.15.1.31:/home/repouser/gitrepos/<mirror-name or path>/platform/manifest -b 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

<li>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.</li> 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"

</ol>