A tool that generates a git branch given a jira ticket number.
- Python 3.8 or newer. You can check your Python version using
python --version
. Consider using pyenv to manage and install different python versions. - Poetry for Python package and environment management. Follow the directions here for installation instructions.
-
Clone the Github repository
git clone https://github.com/jerridan/jitter cd jitter
-
Install the dependencies in a virtual environment using Poetry
make init
-
Package the script into an executable using Pyinstaller
make build
-
Add the resulting executable (located in
dist
folder) to your PATHecho 'export PATH="$PATH:/absolute/path/to/jitter/dist"' >> ~/.zshrc # or ~/.bashrc if you use bash source ~/.zshrc
To use the Jitter Python script, you need to set up a YAML configuration file named .jitter.yml in your home directory. It requires your Jira configuration details including username and API token.
Follow these steps:
You can generate a new API token from your Atlassian account settings, under Security > API tokens.
You can do this by running the following command in your terminal:
touch ~/.jitter.yml
The file should have the following format:
jira:
url: your_jira_url # ex. https://example.atlassian.net
username: your_jira_username
token: your_jira_token
Replace your_jira_url, your_jira_username, and your_jira_token with your actual Jira details.
Note: Treat your API tokens like passwords and keep them secret. API tokens link to your Atlassian account until you revoke them.
After installing the Jitter project, from any directory just run:
jitter [ticket number]
This will create a new branch using the summary. Replace [ticket number]
with your specific Jira ticket number.
For example, if your Jira ticket number is ADA-1234
, run: jitter ADA-1234
If the ticket summary is Add a new feature
, the branch name will be ADA-1234-add-a-new-feature
.
Happy Coding!