- Clone the repository
$ git clone <remote-url>
- Checkout into
devbranch$ git checkout dev
- Pull the latest changes
$ git pull origin dev
- Create a
<branch-name>branch fromdevbranch$ git checkout -b <branch-name> dev # branch-name must contain add/, modify/, fix/ or hotfix/ # e.g. add/feature-name for new feature or hotfix/bug-name for hotfix # push new-branch to remote repository $ git push -u origin <branch-name>
- Make changes and commit each logical change with descriptive message
- Inside your working branch
# check the changed files $ git status # make sure only files are modified which you intend to # stage the changes $ git add file1 file2 file3 ... # to stage all changes at once $ git add . # make sure any file you didn't change shouldn't appear in red in git status # commit the changes $ git commit -m "[TICKET-NO/ISSUE-NO][Add/Modify/Fix/Hotfix] <MESSAGE>" # Message must be descriptive and relevent to the changes in the code
- Checkout into
devbranch and pull any new changes$ git checkout dev $ git pull origin dev
- Checkout into your working branch and merge with dev
$ git checkout <branch-name> $ git merge dev
- Resolve the conflict if any and commit the changes as discussed above
- Push the branch and create the merge request
$ git push -u origin <branch-name>
- Comment the block of code and make your required changes
- Commit the changes describing the changes you made as discussed above
- Delete the commented code with this message format
$ git commit -m "[DCR] <Describe the code block functionality>"