Setup Git - Bitbucket - Redmine 1.x
Follow the instructions to install the Avalarion's Redmine Bitbucket plugin.
I had to manually install the 'json' gem by adding it manually to the Redmine Gemfile and running:
$ bundle install
You now have a folder within the redmine install, that you can change in the plugin settings. Or, you should create it.
Clone the repo to your plugin repo path
$ cd path/to/plugin/repo/path $ git clone --bare https://bitbucket.org/author/my_code
Rename the repo folder to include the author username as a prefix of the repo path.
$ mv my_code.git author_my_code.git
Give the server application the ownership.
$ chown www-data:www-data author_my_code
Note for Apache-Passenger users: www-data is the default user for apache, it's not recommended that you give permission to this user. Best if you create a 'rails' user and assign it as the Passenger user. (#PassengerUser)
Test that you can run a git fetch as your web app user
$ cd path/to/redmine/repo $ sudo -u user git fetch
Note: Make sure the user has the ssh keys to pull from the server, or that the git remote url has the username and password (Not recommended).Â
Add the following settings to the repo, so that it will pull all commits and all tags for all branches using a "git fetch"
$ git config remote.origin.fetch +refs/heads/*:refs/heads/* $ git config --add remote.origin.fetch +refs/tags/*:refs/tags/*










