Git hooks to interface with Trello
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
post-commit
post-to-trello
trello-git-hooks-logo.png

README.md

About

This is a full suit of tools to be able to enable git hooks to interface with Trello

Versions

1.0

  • add comments with associated git commit and alternatively close/archive issues from git commits

Installation How-To

Environment config

  • Install node
  • Install node_trello and colors packages globally
sudo npm install -g node-trello
sudo npm install -g colors
  • Clone this repo and copy the files to your project's .git/hooks folder
  • Make the hooks executable
chmod +x .git/hooks/*
  • run git init to reinitialize the repository to make sure it picks the new hooks

Script Config

  • STEP 1 - get an app key:

https://trello.com/1/appKey/generate

  • STEP 2 - get an app token using app key from step 1

https://trello.com/1/connect?key=<KEY_FROM_STEP_1>&name=git-hook&expiration=never&response_type=token&scope=read,write

(replace KEY_FROM_STEP_1 with an actual key you got in STEP 1)

  • STEP 3 - get board ID:

append .json to any URL while inside the board and look for id: "BOARD_ID",

  • STEP 4 replace

key, token and board_id with the values obtained in steps 1-3

replace repo_link with your repo root URL in the post-to-trello script

Get card IDs to show in Trello

Use this bookmarklet:

javascript:!function(){var o=$(".card-short-id");o.each(function(){$(this).text($(this).text().replace("","").replace("","").replace("N.º ", ""))});o.hasClass("hide")?o.removeClass("hide").css({"font-weight":"normal","font-size":".9em","margin-right":"5px",padding:"2.3px 6px",background:$("body").css("background-color"),"border-radius":"10px",color:"#EE433E"}):o.addClass("hide")}();

Note that due to how Trello injects newly added cards, this won't work on newly added cards unless you refresh the page and toggle this bookmarklet again