User:Srilakshmi sonim/sandbox
Appearance
To Create a New empty git repo on a branch
[edit]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
[edit]- 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.
- Initialize the bare git repo.
- Create a gerrit link via the gerrit account (service account). Login to 10.15.1.31 server with "gerrit" credentials.
- Restart the gerrit services.
- 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.
- Clone the project ( empty repo) in your directory in your home directory.
- Set the branch inside the new project.
- Set the branch to the requested branch.
- Touch a readme file in the directory.
- Add the newly added file.
- commit the Readme 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.
- Push the commit to the empty repo on the requested branch.
- 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.
- 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.
- Commit changes to local repository.
- 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.
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
git init --bare ./<empty-repo-name-requested.git>/ Example: git init --bare ./NetworkSelection.git/
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
cd ~/gerrit-home/git. ~/gerrit-home/bin/gerrit.sh restart Output 1: Stopping Gerrit Code Review: OK Output 2: Starting Gerrit Code Review: OK
mkdir create_branch_for_<git repo/project name> Example : mkdir create_branch_for_NetworkSelection
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
cd <cloned directory> <pre> Example : cd NetworkSelection
git checkout -b <new-branch-requested for empty git repo> Example: git checkout -b 8926-X700-10152-BELL-MR1-MSI1
touch Readme.txt
git add Readme.txt
git commit -am "Committed readme.txt file
git remote -v
git push <remote repo> <requested branch> Example : git push origin 8926-X700-10152-BELL-MR1-MSI1
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
vi default.xml "<project name="platform/vendor/sonim/SonimSetupWizard" path="vendor/sonim/SonimSetupWizard"/>
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
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"