Advanced Git Workflows
In the SFU Open Source Development Club, we follow a streamlined Git workflow to facilitate collaboration and maintain code quality. This document outlines our workflow for managing features, bug fixes, and issues.
Workflow Overview + Detailed Steps
- Branch Creation: Create separate branches for each new feature, bug fix, or issue.
- Development: Implement changes on the designated branch and commit changes with clear and descriptive messages.
- Pushing Changes: Push the branch to the remote repository.
- Create Pull Request: Open a pull request for review and merging.
- Code Review and Merging: Conduct code reviews and merge changes once approved.
- Pull the Latest Changes: Pull the latest changes to ensure your local main is up to date..
1. Branch Creation
When starting work on a new feature, bug fix, or issue, create a new branch off the main
branch.
- Naming Convention: Use the following naming convention for branches:
- Features:
feature/your-feature-name
- Bug Fixes:
bugfix/your-bugfix-name
- Issues:
issue/your-issue-name
- Features:
Example Commands:
# Checkout the main branch
git checkout main
# Pull the latest changes
git pull origin main
# Create a new branch for a feature
git checkout -b feature/new-feature
2. Development
Make changes in your branch. Ensure you frequently commit your work to save progress.
# After making changes
git add .
git commit -m "implement new feature"
3. Pushing Changes
Once you have completed your work and are ready to share it, push your branch to the remote repository.
git push origin feature/new-feature
4. Create a Pull Request
After pushing your branch, create a pull request (PR) in the repository on GitHub
- Description: Provide a clear description of the changes made, referencing any relevant issues.
5. Code Review and Merging
Once the pull request (PR) is created, it is essential for team members to review the changes. This process ensures that the code meets the club's standards and that no issues are overlooked.