You need to install Git Bash software in you local machine.
1. Code Checkout Form Gitlab.
Gitlab URL: https://gitlab.xxxxxxx.com/USP/giftcard
- Get open any browser and enter above url.
- Get login in gitlab using your LDAP Username and Password or Standard Login.
- After login you can see below window.
- Before get code in local need to fork your repository, where you want to get code (copy of code for your changes for with out affecting original code ) form master branch. you need to fork project it will create copy of project on your repository.
- Click on Fork as shown below.
- After fork, you will be enter int your fork project as shown below.
- Create location to checkout GC code Ex: C:\WorkSpace\USP_GC\giftcard.
- Goto giftcard folder and click right side button of mouse and click select Git Bash.
- After select you will get following window.
- In git Bash run git init command for initializing git repository (image 1) OR Use git clone <repo url> command Ex: $ git email@example.com:USP/giftcard.git ( to download the code from specified repo to local ) image 2.
- IF you use clone command then no need to follow step 12 to step 14,if you use init command we need to add remote repository from where we want to get code using : git remote add org (org is alias name) firstname.lastname@example.org:USP/giftcard.git and enter.
- Run the command for add repo : git remote add org email@example.com:USP/giftcard.git
- Do copy your repository link where you want to copy as shown below and again go to the step 9 and add your fork repository link into the git bash (in 2nd image).
- After adding remote repo, you can use pull the code form master repo to your fork repo using git pull command Ex:git pull org master.
You will see code got download in your location folder.
2. Code Checkin into Gitlab (Pushing changes).
- Open Git GUI and click on Open Existing Repository.
- Browse your local repository where you have done the changes and click on Open button.
- You will get following windows, In this you can see Unstaged changes files, Staged changes (which will be going to commit), commit Message and 4th one for what changes you have done in the file.
- Rescan button use for find the changes files form your repo, stage Changed button use for which file you wants to commit into the repo. commit for commit the file into the repo, after commit you can push it to the your gitlab repo.
- Once you staged changes file you need to write commit message (Note : Do staged only those file which you have wants to be commit or you have done changes) after that click on commit button.it will ask your username and password, and file changes will committed into the your fork repo.
- Once your changes has been committed into the repo you can push that file into the master repo. (Note : you should have the authorization for pushing changes into the master branch otherwise you need create a merge request)
3. How to create a merge request.
- Once changes has been committed into your fork branch. you need to create a merge request to a person who is having higher authority to merge the changes with master branch code.
- Merge request can be create form your gitlab, go to your gitlab URL and get log in using your LDAP id and password.as follows.
- Click on fork button, It will go to your fork project window.
- Click on Marge Requests, you will get below window.
- After that click on New Merge Request. and in the Source Branch select source project and source branch(form merge) ,same for Target Branch select target project(To merge).
- After that click on Compare branches and continue. and Enter Title and Description and assign to Authorize person who have the right to merge.and submit merge request.
- After submit, your request will go to Authorize per and he will merge the changes with Master Branch.