Generic tools and instructions for making it easier to work with git. Clone this repo somewhere on your machine.
To use these, you need to add them to your $PATH. Add something like this to your ~/.profile
or ~/.bash_profile
or whatever:
export PATH=$PATH:<path/to/gitplus>/commands
Once added, you'll probably need to source your profile file or start a new terminal window. Then you'll have access to the following commands.
Run git plus upgrade to easily pull the latest of this repo's origin/main branch to your machine.
git plus help will cat the contents of this README
Sort of like "flow start ", but slightly different just to be confusing.
Starts a type/name
branch, usually a feature or hotfix, and starts from the correct starting branch for you.
# start a hotfix (off of default branch)
$ git start hotfix 1234-desc
# start a feature (off of develop by default)
$ git start feature 1234-desc
# start whateveryouwant off of a specified branch
$ git start whatever 1234-desc main
Work specific Naming conventions of branches are more rigid
# Create a branch from develop
git start wb 123-BranchName
# Create a branch from default branch
git start wb 123-BranchName master
Does a --no-ff merge to main (if hotfix) and develop. Will also work in repos that don't have a develop branch by merging to default branch.
Specify "push" as the last argument to auto-push merged branch(es).
# Merge hotfix/1234 to main and develop
$ git finish
# Merge feature/1234 to develop only
$ git finish
# Merge feature or hotfix and push merged branch(es) to origin
$ git finish push
# Merge whatever/1234 to main and develop (specify type is hotfix)
$ git finish hotfix
# Merge other branch and push merged branch(es) to origin
$ git finish hotfix push
Merges develop into main locally, using a --no-ff merge to create an explicit merge commit.
Specify "push" as the last argument to auto-push main after merge.
# Merge develop to main
$ git promote
# Also push main to origin
$ git promote push
Merges main or develop into your current branch depending on your branch type and if there is a develop branch available. It will also merge main into develop if on the develop branch.
Specify "rebase" to rebase the changes rather than merge them.
# Merge develop or main into your branch
$ git update
# Rebase develop or main into your branch
$ git update rebase
List commits on your current branch in the origin
remote that aren't present locally.
$ git in
List commits on your current branch locally that are not in the origin
remote.
$ git out
Opens the current repo in your browser. No auth required because the browser does auth for you. Note: Only supports GitHub and GitLab atm
$ git open
Deletes a branch both locally and at remote
$ git del-branch branch-name
# If branch has not been pushed or not merged you will have to --force
$ git del-branch branch-name --force
Checks out a branch based on a substring
# this would check out a branch that starts with `br`
$ git find br