Git-Floss is a CLI tool designed to work either in command-line only, or to be used in a GUI to manage git repositories for projects whether a NodeJS project or other. GUI project will be a separate project and is a work-in-progress.
The following article is what inspired me to create this project: A Successful GIT Branching Model
Here is an example image from the above article describing what projects using this tool might look like:
A feature branch is (usually) a local branch. It branches from develop. It merges back into develop, but never master. That’s where release branches come in. It can be named anything valid in git, except for release-, hotfix-, develop, and master.
| If co-workers need to assist with a feature, the feature can be pushed to the remote repository, and locally created and pulled by the assisting developer. (This | is where the GUI will come in handy later to avoid confusion and mistakes by keeping track of “public” features, releases, and hotfixes, and which users are | allowed to create, pull, update, merge, and delete for each type of branch, stored in a database of some kind.)
The following flow is recommended for incorporating a feature.
git-floss create-feature -u “<userName>” -n “<feature-name>”- Add and edit code as needed.
git-floss commit-current-branch -u “<userName>” -n “<feature-name>”git-floss merge-feature -u “<userName>” -n “<feature-name>”
When a project is ready for a release to production, all features for that release must be committed and merged into develop like above. Then the following flow takes place:
git-floss create-release -j “<-j goes here to indicate whether this is for a NodeJS/Typescript project with apackage.jsonfile.”(git-floss create-release -j)- This creates a release branch from develop.
- Test and fix bugs in this release- branch, committing and pushing as needed.
- Once all known bugs are fixed, while on the current release branch, type
git-floss merge-release-develop.- Order matters here! If merged to master first, the release branch is deleted. Merge to develop like above first!
git-floss merge-release-master- Again, order matters!
If something is later found in production that needs to be fixed, that’s where hotfixes come in. Hotfixes are branched from master. The process is the same like above for release branches, except replace the word release with hotfix in the commands.
Finally, when you are ready for the big 1.0.0 release, the following flow occurs:
git-floss create-major-release -j “-j is for nodejs projects”(git-floss create-major-release -j)- Test and fix any straggling bugs in this branch, committing and pushing as needed.
- Once all known bugs are fixed, while on the current release branch, type
git-floss merge-release-develop.- Order matters here! If merged to master first, the release branch is deleted. Merge to develop like above first!
git-floss merge-release-master- Again, order matters!
If working collaboratively, ensure the feature has your unique user name for the project and a valid name, then type the following command:
git-floss push-feature -u "<userName>" -n "<feature-name>"
git-floss [command]
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
git-floss create-feature
Creates a feature branch based on develop.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
-n, --name The name of the feature branch. [string]
-u, --userName The name of the user creating the feature branch. [string]
git-floss merge-feature
Merges a feature branch into develop.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
-n, --name The name of the feature branch. [string]
-u, --userName The name of the user merging the feature branch. [string]
git-floss delete-feature-branch
Deletes the un-needed feature branch.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
-n, --name The name of the branch to delete. [string]
-u, --userName The user name of the person deleting the branch. [string]
git-floss create-release
Stages develop for a new release.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
-j, --nodejs Whether the target project is a NodeJS/Typescript
project with a package.json file. [boolean]
git-floss create-major-release
Stages develop for a new major release.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
-j, --nodejs Whether the target project is a NodeJS/Typescript
project with a package.json file. [boolean]
git-floss merge-release-develop
Merges release into develop
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
git-floss merge-release-master
Merges release into master and deletes the local release branch.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
git-floss checkout-release-branch
Checks out release.
Options:
-v, --version The release version to checkout. [string]
-h, --help Show help [boolean]
git-floss push-release-branch
Pushes release.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
git-floss bump-release-version
Increases the minor release version and resets the hotfix version to 0.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
-d, --cwd The current working directory for the process
that ran the command. [string]
-j, --nodejs Whether the target project is a NodeJS/Typescript
project with a package.json file. [boolean]
git-floss bump-major-release-version
Increases the major release version and resets the hotfix version and minor
release version to 0.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
-d, --cwd The current working directory for the process
that ran the command. [string]
-j, --nodejs Whether the target project is a NodeJS/Typescript
project with a package.json file. [boolean]
git-floss delete-local-release
Deletes the un-needed release... (ONLY AFTER MERGING INTO MASTER AND DEVELOP!!!)
Options:
-v, --version The release version (Major or Minor) [string]
-h, --help Show help [boolean]
git-floss create-hotfix
Stages master for a patch.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
-j, --nodejs Whether the target project is a NodeJS/Typescript
project with a package.json file. [boolean]
git-floss merge-hotfix-develop
Merges hotfix into develop
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
git-floss merge-hotfix-master
Merges hotfix into master and deletes local hotfix branch.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
git-floss checkout-hotfix-branch
Checks out hotfix.
Options:
-v, --version The hotfix version to checkout. [string]
-h, --help Show help [boolean]
git-floss push-hotfix-branch
Pushes hotfix.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
git-floss bump-hotfix-version
Increases the hotfix version.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
-d, --cwd The current working directory for the process
that ran the command. [string]
-j, --nodejs Whether the target project is a NodeJS/Typescript
project with a package.json file. [boolean]
git-floss delete-local-hotfix
Deletes the un-needed hotfix... (ONLY AFTER MERGING INTO MASTER AND DEVELOP!!!)
Options:
-v, --version Hotfix version. [string]
-h, --help Show help [boolean]
git-floss commit-current-branch
Commits the currently checked out branch.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
-u, --userName The user name of the person committing the branch. [string]
-m, --message The message for the commit. [string]
git-floss push-current-branch
Pushes the currently checked out branch to origin.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
git-floss checkout-branch
Checks out an existing branch.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
-n, --name The name of the branch to checkout. [string]
-u, --userName The user name of the person checking out the branch. [string]
git-floss checkout-develop-branch
Checks out develop.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
git-floss checkout-master-branch
Checks out master.
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
You will need nvm for Windows on Windows, or nvm if on Linux or Mac OS.
This project has been tested with node 14.17.0 in the LTS releases.
After nvm is installed, open a command-line or terminal, and type:
nvm install 14.17.0nvm use 14.17.0npm install- This will download and install project dependencies.npm run global-install- This will install and package the project to it’s running OS’s executable as well as set environment variablePATHto addgit-flosspath to the executable so thatgit-flosscan be typed instead of /git-floss.
Feel free to fork this project or create a pull request to contribute!
