Skip to content

Git Workflow

No need for the "fork-based" branching model described below. Instead, we work with branches on the origin repo.
1. Make sure the repo is cloned
2. Make a branch.
3. Do the commits
4. Push branch
5. Open PR towards master branch:
1. Its title should be [Ticket-id] Descriptive title, i.e. [MIB-123] Optimized transaction table.
2. Make sure to read and check the boxes in the PR description
3. Someone else will need to code review to merge.
4. PRs are posted in the #majority-backend-pr channel

TODO: Expand/cleanup these instructions.

DEPRECATED / OLD steps below

Tools

  1. Install 4ux-nbIx/posh-git-workflow and put Import-Module statement into your PowerShell profile

Workflow

  1. Fork a repository in Azure DevOps. Use Fork-All-Repos.ps1 to for and git clone all repos in a project.
  2. git clone your fork
  3. Create a feature branch (New-GitFeature)
  4. Push changes to the feature branch in your local fork
  5. Push your changes to remote fork
  6. Submit a Pull Request
  7. Specify Jira ticket ID in the PR title (within brackets)
  8. Walk through the check-list in PR description and tick all boxes even if the check-list items don't apply to the change
  9. Wait for the PR build to complete and resolve all review comments
  10. Merge the PR

posh-git-workflow

  1. Get the latest changes from the central repo:
    Sync-GitFork
    
  2. Make changes
    ##  Sync your fork and create a feature branch
    New-GitFeature branch-name # a feature/branch-name branch will be created and checked out
    
    ##  commit changes
    
    ##  Create a PR
    Complete-GitFeature
    ##  your local feature branch will be pushed to your remote fork and a new PR page will be opened in Azure DevOps
    
    ##  Push more changes to the open PR
    git commit # to your feature branch
    git push # your feature branch
    
  3. Check posh-git-workflow GitHub page for more details

Automating Sync-GitFork

If you want to sync all your forked repos at once, you can use this tool:
1. Download Sync-All-Repos.ps1 and place it in your root Projects folder.
2. Run it