Skip to content

Committing Your Changes

Sk Niyaj Ali edited this page Dec 25, 2024 · 1 revision

Prerequisites

To Stash and Commit your changes make sure Git is installed on your machine and configured. navigate to the environment setup for more information here


Pre-push checks

Before opening a Pull Request or committing your changes, make sure to run these commands to ensure code quality

Note

We've integrated git hooks🪝 in our project for checking the code quality when committing or pushing your changes and if you get any errors then it doesn't allow you to commit or push your changes.

Command Purpose What It Checks
./gradlew check -p build-logic Validate Build Configuration - Checks build script integrity
- Verifies build logic configuration
./gradlew spotlessApply Code Formatting - Enforces consistent code style
- Automatically formats code
./gradlew dependencyGuardBaseline Dependency Management - Tracks and validates project dependencies
- Prevents unexpected dependency changes
./gradlew detekt Static Code Analysis - Performs advanced code quality checks
- Identifies potential code smells
- Enforces coding standards
./gradlew build Complete Build Process - Compiles entire project
- Runs all configured checks and tests
./gradlew updateProdReleaseBadging App Badging Update - Updates application icon and metadata
- Ensures consistent app presentation

Or Use the all-in-one script for convenience: ./ci-prebuild.sh or ci-prebuild.bat.


Commit Your Changes

Stash and Commit your changes with a meaningful commit message that describes the purpose of your changes:

  • Go to the Version Control window (View > Tool Windows > Commit).
  • You'll see a list of un-versioned files in the Changes List.
  • Click the top-level checkbox to select all the files or select individual files.
  • Add a commit message describing your changes.
  • Click Commit (or press Ctrl+K on Windows/Linux or Cmd+K on macOS).

Push Your Changes

If you want to push your changes to a remote Git repository (e.g., GitHub, GitLab), you need to set up a remote URL.

  • Go to VCS > Git > Push (or press Ctrl+Shift+K on Windows/Linux, Cmd+Shift+K on macOS).
  • Select the commit you want to push. If you have multiple commits select all and squash them.
  • Click Push.

Open a Pull Request

Once your changes are pushed to your forked repository, you can initiate a pull request to merge your changes into the main project:

  1. Navigate to the Mifos Mobile repository on GitHub.

  2. Click on the "Pull Requests" tab and then click "New Pull Request."

New Pull Request

  1. Ensure the base repository is set to "openMF/mifos-mobile" and the base branch is the main development branch dev.

  2. Set the compare repository to your forked repository and the compare branch to the branch you just created with your changes (e.g., in my case, the head repository was set to rchtgpt/mobile-wallet and the comparison branch was kotlin-migration-common.

  3. Fill out the pull request template, providing a clear description of your changes, why they are necessary, and any relevant information for the reviewers.

  4. Click "Create Pull Request" to submit your changes for review.

Demo Credentials

  1. Username: mifos
  2. Password: password
Clone this wiki locally