diff --git a/.github/.gitconfig b/.github/.gitconfig new file mode 100755 index 00000000..60b00482 --- /dev/null +++ b/.github/.gitconfig @@ -0,0 +1,157 @@ +# Git Configuration +# See: http://michaelwales.com/articles/make-gitconfig-work-for-you/ + +# Git Helpers +[alias] +# Git add and commit - all in one step +ac = "!f() { git add .; git cm \"$@\"; }; f" + +# Add new git remote +ar = "!f() { git remote add \"$0\" \"$1\"; }; f" + +# Execute git branch command +b = "!f() { git branch $@; }; f" + +# Delete a branch locally +bdel= "!f() { git b -D $@; }; f" + +# Delete a branch remotely +bdelr= "!f() { git push origin --delete $@ --no-verify; }; f" + +# Checkout branch +ch = "!f() { git checkout $@; }; f" + +# Checkout and push new branch to origin +chb = "!f() { git ch -b \"$@\"; git puo \"$@\"; }; f" + +# Checkout branch and pull latest version +chp = "!f() { git ch $@; git pull; }; f" + +# Commit with message +cm = "!f() { git commit -S -m \"$@\"; }; f" + +# Create new local repo, perform initial commit, and push +launch = "!f() { git init; git chore \"first commit\"; git b -M next; git rao $1; git puo next; }; f" + +# Tell Git to start tracking branch and push to origin +puo = "!f() { git push -u origin $@ --no-verify; }; f" + +# Add new remote origin +rao = "!f() { git remote add origin $@; }; f" + +# Rebase branch +rb = "!f() { git rebase $@; }; f" + +# Remove local .git directory +restart = "!f() { rm -rf .git; echo \"removed .git directory.\"; }; f" + +# Undo last commit +ulc = "!f() { git reset HEAD~1 --soft; }; f" + +# Conventional Commits +# See: https://www.conventionalcommits.org/ +# See: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#type +[alias] +# Changes that affect the build system or external dependencies +build = "!f() { git ac \"build: $@\"; }; f" + +# Changes to our CI configuration files and scripts +ci = "!f() { git ac \"ci: $@\"; }; f" + +# Changes that don't impact external users +chore = "!f() { git ac \"chore: $@\"; }; f" + +# Documentation only changes +docs = "!f() { git ac \"docs: $@\"; }; f" + +# New features +feat = "!f() { git ac \"feat: $@\"; }; f" + +# Bug fixes +fix = "!f() { git ac \"fix: $@\"; }; f" + +# Performance improvements +perf = "!f() { git ac \"perf: $@\"; }; f" + +# Code improvements +refactor = "!f() { git ac \"refactor: $@\"; }; f" + +# Revert past changes +revert = "!f() { git ac \"revert: $@\"; }; f" + +# Changes that do not affect the meaning of the code +style = "!f() { git ac \"style: $@\"; }; f" + +# Adding missing tests or correcting existing tests +test = "!f() { git ac \"test: $@\"; }; f" + +# Work in progress (i.e feature implemented, but not tested) +wip = "!f() { git ac \"wip: $@\"; }; f" + +# Branch Naming Conventions Aliases +[alias] +# Create a new bugfix branch and push upstream +chbb = "!f() { git chb bugfix/$@; }; f" + +# Create a new hotfix branch and push upstream +chbh = "!f() { git chb hotfix/$@; }; f" + +# Create a new feature branch and push upstream +chbf = "!f() { git chb feat/$@; }; f" + +# Create a new release branch and push upstream +chbr = "!f() { git chb release/$@; }; f" + +# Create a new support branch and push upstream +chbs = "!f() { git chb support/$@; }; f" + +# Helper Aliases +[alias] +# Generate a SSH key +keygen = "!f() { ssh-keygen -t rsa -b 4096 -C \"$@\"; }; f" + +# Recursively delete files matching a pattern +pdel = "!f() { find . -type f -name \"$@\" -delete; }; f" + +# Generate a secret signing key +signingkey = "!f() { openssl rand -base64 32; }; f" + +# Husky +[alias] +# Force push commits without running `pre-push` hook +fpnv = "!f() { git push --force --no-verify; }; f" + +# Push commits without running `pre-push` hook +pnv = "!f() { git push --no-verify; }; f" + +[core] +autocrlf = input +ignorecase = false + +[credential] +helper = osxkeychain + +[gitflow "prefix"] +feature = feat/ +hotfix = hotfix/ +release = release/ +support = support/ +versiontag = v + +[init] +defaultBranch = next + +[pull] +rebase = true + +[tag] +forceSignAnnotated = false + +[url "git@bitbucket.org:"] +insteadOf = bb: + +[url "git@github.com:"] +insteadOf = gh: + +[url "https://gist.github.com/"] +insteadOf = gist: diff --git a/docs/.gitconfig b/docs/.gitconfig deleted file mode 100755 index b597671f..00000000 --- a/docs/.gitconfig +++ /dev/null @@ -1,138 +0,0 @@ -# Git Configuration -# See: http://michaelwales.com/articles/make-gitconfig-work-for-you/ - -# General Aliases -[alias] - # Git Add & Commit - All in one step - ac = "!f() { git add .; git cm \"$@\"; }; f" - - # Add new git remote - ar = "!f() { git remote add \"$0\" \"$1\"; }; f" - - # Checkout and push new branch to origin - b = "!f() { git checkout -b \"$@\"; git puo \"$@\"; }; f" - - # Delete a branch locally - bdel= "!f() { git branch -D $@; }; f" - - # Delete a branch remotely - bdelr= "!f() { git push origin --delete $@ --no-verify; }; f" - - # Git Commit with message - cm = "!f() { git commit -m \"$@\"; }; f" - - # Checkout branch - ch = "!f() { git checkout $@; }; f" - - # Checkout branch and pull latest version - chp = "!f() { git ch $@; git pull; }; f" - - # Create new local repo, perform initial commit, and push to Github - launch = "!f() { git local; git rao $@; git puo next; }; f" - - # Start a new local repository and perform initial commit - local = "!f() { git init; git add -A; git chore initial commit; git branch -M next; }; f" - - # Tell Git to start tracking branch and push to origin - puo = "!f() { git push -u origin $@ --no-verify; }; f" - - # Add new remote origin - rao = "!f() { git remote add origin $@; }; f" - - # Remove local .git directory - restart = "!f() { rm -rf .git; echo \"Removed .git directory.\"; }; f" - -# Conventional Commits -# See: https://www.conventionalcommits.org/ -# See: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#type -[alias] - # Changes that affect the build system or external dependencies - build = "!f() { git ac \"build: $@\"; }; f" - - # Changes to our CI configuration files and scripts - ci = "!f() { git ac \"ci: $@\"; }; f" - - # Changes that don't impact external users - chore = "!f() { git ac \"chore: $@\"; }; f" - - # Documentation only changes - docs = "!f() { git ac \"docs: $@\"; }; f" - - # New features - feat = "!f() { git ac \"feat: $@\"; }; f" - - # Bug fixes - fix = "!f() { git ac \"fix: $@\"; }; f" - - # Performance improvements - perf = "!f() { git ac \"perf: $@\"; }; f" - - # Code improvements - refactor = "!f() { git ac \"refactor: $@\"; }; f" - - # Revert past changes - revert = "!f() { git ac \"revert: $@\"; }; f" - - # Changes that do not affect the meaning of the code - style = "!f() { git ac \"style: $@\"; }; f" - - # Adding missing tests or correcting existing tests - test = "!f() { git ac \"test: $@\"; }; f" - - # Work in progress - wip = "!f() { git ac \"wip: $@\"; }; f" - -# Git Flow Aliases -[alias] - # Create a new feature branch and push upstream - feat = "!f() { git b feat/$@; }; f" - - # Create a new hotfix branch and push upstream - hotfix = "!f() { git b hotfix/$@; }; f" - - # Create a new release branch and push upstream - release = "!f() { git b release/$@; }; f" - - # Create a new support branch and push upstream - support = "!f() { git b support/$@; }; f" - -# Helper Aliases -[alias] - # Generate a SSH key - keygen = "!f() { ssh-keygen -t rsa -b 4096 -C \"$@\"; }; f" - - # Recursively delete files matching a pattern - pdel = "!f() { find . -type f -name \"$@\" -delete; }; f" - - # Generate a secret signing key - signingkey = "!f() { openssl rand -base64 32; }; f" - -# Husky -[alias] - # Force push commits without running `pre-push` hook - fpnv = "!f() { git push --force --no-verify; }; f" - - # Push commits without running `pre-push` hook - pnv = "!f() { git push --no-verify; }; f" - -[core] - ignorecase = false - -[gitflow "prefix"] - feature = feature/ - release = release/ - hotfix = hotfix/ - support = support/ - versiontag = v - -[init] - defaultBranch = main - -[url "https://bitbucket.org/"] - insteadOf = bb: - -[url "https://github.com/"] - insteadOf = gh: - -[url "https://gist.github.com/"] - insteadOf = gist: diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 8dbdeb7d..cdbf7a32 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -17,8 +17,8 @@ well as follow our coding guidelines. ### Git Configuration -Copy the [starter Git global configuration](.gitconfig) to stay inline with our -coding guidelines, as well as begin extending your own workflow. +Copy the [starter Git global configuration](../.github/.gitconfig) to stay +inline with our coding guidelines, as well as begin extending your own workflow. **Note**: The examples below will uses aliases from the starter config. @@ -27,7 +27,8 @@ coding guidelines, as well as begin extending your own workflow. 1. Copy the snippet below to clone the project onto your local machine: ```zsh - git clone https://github.com/flex-development/tutils.git; cd tutils + git clone https://github.com/flex-development/tutils.git + cd tutils yarn ``` @@ -49,7 +50,7 @@ When creating a new branch, the name should match the following format: For example: ```zsh - git feat repo-setup +git feat repo-setup ``` will create a new branch titled `feat/repo-setup` and push it to `origin`. @@ -76,7 +77,7 @@ Commit messages should be one of the following types: For example: ```zsh - git chore "add eslint configuration" +git chore "add eslint configuration" ``` will produce the following commit: `chore: add eslint configuration`