Tuesday, April 23, 2019

GitHub repository workflow using gitflow mechanism

This workflow will describe all the necessary steps that you need to follow to release a project.

It is targeted for those projects where more than one members are contributing in the project because that will require a standard workflow that will keep the quality in check at each level.

So try to follow the steps as mentioned below, where a repository have been taken for sample.
  1. First you need to setup the codebase on your local machine
    1. Create a clone of the repository
      • git clone "project-repository-git-url"
    2. Get inside the repository folder
      • cd "project-repository-path"
    3. Refer this article to learn more about the gitflow mechanism of handling a project
    4. Enable git flow mechanism on the current repository
      • git flow init -d
      • It is required to be done by each contributor on their respective clones
    5. Check out develop branch
      • git checkout develop
    6. Copy & paste all the code in this folder from previous repo
    7. Update .gitignore file by adding file/folder name that you don't want to add in repo
    8. Stage all the relevant & required files
      • git add .
    9. Commit the code with relevant message
      • git commit -m "your-commit-message"
    10. If you add issue number in you commit message like #1 Added initial codebase, then the commit would reflect under issue from which it is associated 
      • git commit -m "#issue-number your-commit-message"
    11. Push the committed code
      • git push
  2. Once you have made a stable code base in develop branch then raise pull request to merge it in master branch.
  3. When your pull request will get approved, then either you or approver can merge the pull request to the master branch.
  4. Using gitflow you need to create release branch as
    • git flow release start release-1.0.0
    • Test this code base to make sure everything is stable and releasable
    • git flow release finish 'release-1.0.0'
  5. Then, go to releases section of the repository
  6. Create new release
    1. Mention Tag version, e.g., v1.0.0
    2. Choose the Target branch as release-1.0.0
    3. Mention the Release title as Release v1.0.0
    4. Add the release notes in the Describe section that should contain all the relevant text in points like
      1. New features added
      2. Bugs fixed
      3. Limitations if any
    5. Attach the binary files like installer exe, apk, app, etc.
    6. Click on Publish release button to make it release it publicly

Note: Although I have mentioned all the steps using command line but I'll recommend you to use Sourcetree app instead because it will provide a lot of ease while following the workflow.

No comments:

Post a Comment