We follow a simplified branching strategy to keep our development organized:
- We have a single main branch (
main
) that serves as the primary development branch. - For each new feature or bug fix, team members create separate
feature
branches. Check out these notes on how to name the branches. - Once a feature is complete and tested, it is
merged
into the main branch.
To contribute to this project, follow these steps to create new branches and make pull requests:
-
Clone the repository to your local machine:
git clone https://github.com/hamitsehjal/CampusCart-BACKEND.git
-
Create a new branch for your feature or bug fix:
# Create a new branch and switch to it git checkout -b feature/my-feature
-
Make your code changes, commits, and push your branch to the remote repository
# Make code changes and commit them git add . git commit -m "Add your descriptive commit message here" # Push your branch to the remote repository git push origin feature/my-feature
-
Create a Pull Request (PR) on GitHub:
- Go to the GitHub repository.
- Click on the "Pull Requests" tab.
- Click the "New Pull Request" button.
- Choose your branch as the source and the main branch as the target.
- Add a descriptive title and description for your PR.
- Click "Create Pull Request"
- Your PR will be reviewed by team members, and any necessary discussions or changes will be made before merging.
-
Use Descriptive Names
-
Include a Prefix
feature/
: For new features or functionalitybugfix/
: For bug fixeshotfix/
: For critical fixes that need immediate attentionrefactor/
: For code refactoringdocs/
: For documentation changeschore/
: For general maintenance taskstest/
: For test-related tasks
-
Include issues or User Story Information
- Example:
feature/setup-mongodb-123
(for a branch associated with issue #123)
- Example: