Last active
January 9, 2023 16:00
-
-
Save Mearman/02769607e96f0d75ad8ad6ba725e85c6 to your computer and use it in GitHub Desktop.
Git WIP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias git-wip='function _git-wip() { | |
| branchName="WIP/$(date -Idate | cut -c1-4)/$(date -Idate | cut -c6-7)/$(date -Idate | cut -c9-10)" | |
| # git checkout -b "$branchName" || git checkout "$branchName" | |
| # Check if the branch already exists | |
| if git rev-parse --verify "$branchName" >/dev/null 2>&1; then | |
| # Check out the existing branch | |
| git checkout "$branchName" | |
| else | |
| # Create a new branch and check it out | |
| git checkout -b "$branchName" | |
| fi | |
| echo | |
| echo "$(git status --porcelain)" | |
| echo | |
| git commit -am "$(date -u +`%Y-%m-%dT%H:%M:%SZ`)" -m "$(git status --porcelain)" | |
| };_git-wip' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment