Changing Code in GIT Repository via Customer Branch
In some cases we might offer you a possibility to update code in our Git repository in order for all parties to have the same controlled environment for code and related file updates and changes. In order for us to retain control over the process we will create a special code branch that you will have write access to. After making the changes you will be able to ask us to include these changes in the main code base and deploy them.
Step-by-step guide
- Follow these steps to set up Sourcetree and access to repository
- Read about the theory behind usage of MASTER and DEVELOP branches as using an additional customer branch is an expansion of the same principle
- In Sourcetree locate the CUSTOMER-XXXX branch created for you under the Remotes section and double click it:
- It will appear under the BRANCHES section in bold (make sure it is active/bold when about to update any files in the future as well):
- Add/change the needed files to you git folder and you will see that there are changes in your workspace:
- When you click on the File status you will see the changed/added files listed in the Unstaged files section. You should select either all or some of them so that they appear in the Staged files section:
- Enter a comment for this commit. If you can (preferably) allocate a specific JIRA issue - please mention that on the first line of commit message
Press Commit button
You can do this multiple times. I.e. you don't have to wait for the commit only when you are 100% ready with the code or files you wish to deliver. You can commit as many times as you wish and only when done continue to the next step.
- Right-click the CUSTOMER-XXXX and select Create pull-request:
- You will be redirected to Stash where you can select to which branch you wish to transfer your changes. Normally the correct branch (in this example DEVELOP) should be selected by default:
- After pressing Create a new pull request (i.e. a request for us to pull your changes into the main branch) will be created and we will be notified about that. However it is better to wither add a comment to an issue or create a new one for us to do it within the expected timeframe.
- Once the code will be merged it is possible to deploy it which you should also explicitly ask us to do together with the merge request.
Related articles