When using Git and GitLab to develop and check-in changes to the RAS codebase, follow this process.
1) Create a new branch for your work
Create a new branch in your local git repository that you will use to perform the work. Open a git bash shell within the appropriate repo, then run the command:
git checkout -b branch_name
The 'branch_name' should be substituted with the JIRA number of the related ticket (e.g., RAS-1234).
This command will create a new branch with the given name and switch your view within git to that new branch. The branch you're currently working in will be displayed in the git bash shell in parentheses.
2) Make your changes on the branch
While in the branch, perform whatever work you need to do as normal. You can add new files to the repo with the command 'git add' and commit changes with 'git commit'. You can commit multiple times on the same branch, and the changes will remain local to your machine until you push them to GitLab in the next step.
If you are working on multiple tickets simultaneously, you can switch between branches with the command 'git checkout another_branch_name'. You will need to commit your outstanding changes in the current branch before switching; if you prefer not to do this, you can also use the 'git stash' command to temporarily save your changes and restore them later (see the documentation for git stash).
3) Push your branch to GitLab when it's ready to be merged
Once you've completed work on your branch and are ready to merge it, push it to the GitLab server with the command:
git push origin branch_name
This command will push your branch and all of its committed changes to the central GitLab server.
4) Create a Merge Request in GitLab
Related articles