Skip to content

Instantly share code, notes, and snippets.

@nabily4e-dev
Last active March 13, 2023 14:14
Show Gist options
  • Save nabily4e-dev/19bccfc55f341024e5e3aa96a46ec60d to your computer and use it in GitHub Desktop.
Save nabily4e-dev/19bccfc55f341024e5e3aa96a46ec60d to your computer and use it in GitHub Desktop.
Possible feature branch names are:
* `feature/add-login-form`
* `feat/fix-bug-123`
* `f/improve-performance`
=>//
Feature branch naming convention is a way of naming your feature branches in a consistent and meaningful way. There are different ways of doing this, but some common elements are:
* Using a prefix to indicate that the branch is a feature branch, such as `feature/`, `feat/`, or `f/`.
* Using a descriptive name that summarizes what the feature does or what problem it solves, such as `add-login-form`, `fix-bug-123`, or `improve-performance`.
* Using hyphens to separate words in the name, and avoiding spaces or underscores.
* Using lowercase letters and avoiding special characters or punctuation.
Possible commit messages are:
Add login form with validation and error handling.
Fix bug 123 where login form crashes on invalid input.
Improve performance of login form by caching results and reducing queries.
=>//
The messages for commits in feature branches should be clear and concise, and describe what changes you made and why. Some tips for writing good commit messages are:
* Use the imperative mood, such as “Add login form”, “Fix bug 123”, or “Improve performance”.
* Start with a capital letter and end with a period.
* Limit the first line to 50 characters or less, and use additional lines if needed to explain more details.
* Use bullet points or lists to separate multiple changes or items.
* Reference the issue number or the feature name if applicable, such as “#123” or “[login-form]”.
* Avoid using vague or generic terms, such as “Update”, “Refactor”, or “Fix”.
* Avoid repeating information that is already in the branch name or the file names.
Implementing git-flow in your project:
1. Install git-flow on your computer. Depending on your operating system, you can use different commands or tools to do this.
2. Go to your project folder and run `git flow init`. This will create the `main` and `develop` branches for you and set up some options.
3. Whenever you want to work on a new feature, run `git flow feature start feature_name`. This will create a new branch from `develop` for your feature.
4. Work on your feature and commit your changes as usual. You can test your changes locally or on a preview server if you have one.
5. When your feature is done, run `git flow feature finish feature_name`. This will merge your feature branch to `develop` and delete it.
6. Repeat steps 3-5 for each feature you want to add.
7. When you are ready to make a new release, run `git flow release start version_number`. This will create a new branch from `develop` for your release.
8. Make any final changes or fixes on your release branch and update the version number if needed.
9. Run `git flow release finish version_number`. This will merge your release branch to both `main` and `develop`, tag it with the version number, and delete it.
10. Push your changes to the remote server with `git push --all` and `git push --tags`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment