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¶
- Install 4ux-nbIx/posh-git-workflow and put Import-Module statement into your PowerShell profile
Workflow¶
- Fork a repository in Azure DevOps. Use Fork-All-Repos.ps1 to for and git clone all repos in a project.
- git clone your fork
- Create a feature branch (New-GitFeature)
- Push changes to the feature branch in your local fork
- Push your changes to remote fork
- Submit a Pull Request
- Specify Jira ticket ID in the PR title (within brackets)
- Walk through the check-list in PR description and tick all boxes even if the check-list items don't apply to the change
- Wait for the PR build to complete and resolve all review comments
- Merge the PR
posh-git-workflow¶
- Get the latest changes from the central repo:
Sync-GitFork - 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 - 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