Подключите Dreamweawer CS6 к хранилищу Bitbucket

357
Rajdeep Siddhapura

У меня есть Git-репозиторий на Bitbucket, и я хотел бы настроить управление версиями в Dreamweaver CS6.

Как мне это сделать?

0

1 ответ на вопрос

0
Brian Mallett

I wrote an article/how to on this a while back. Hope it helps. Should take you step by step. I know link only answers are a no no, but this is way too entailed to answer in a comment. I had another post that was deleted for this. Since they don't like the link answer, I'll add the whole article under the link:

http://bbdokc.com/blog/the-mysterious-git-using-git-with-dreamweaver-and-bitbucket

The mysterious Git: Using Git with Dreamweaver and Bitbucket Image THE MYSTERIOUS GIT: USING GIT WITH DREAMWEAVER AND BITBUCKET We have started using Git more and more here at Black Belt Designs, and I thought that it was time to share a little bit about what we have learned while using it. Git is a FREE, open source, distributed version control system that is designed to handle everything from small to extremely large projects with speed efficiency. I know many people still use Adobe’s Dreamweaver and believe it or not, according to some searching online, many are doing this on a Windows based machine. Contrary to popular beliefs, Dreamweaver is a decent IDE and has many powerful tools available to use if you know how to use them. I figured today, I would go over how we got Dreamweaver to use Git as our VCS using a free repo service from Bitbucket. This article will assume the following: You are on a Windows system You are using Dreamweaver You aren’t scared to try new things The first thing you need to do is install Git. For the windows installer, download it from the Git website here: http://git-scm.com/download/win. The Windows installer (msi) makes installing Git on Windows pretty straightforward. For our install, we used the following settings.

Now Git is installed on your windows machine. The next step is to install TortoiseGit. TortoiseGit is available on Google Code here: https://code.google.com/p/tortoisegit/wiki/Download?tm=2. Select which version you need on your machine. Ours is a Windows 8 64-bit machine so we downloaded the 64-bit version. For the TortoiseGit install, we only make a change in selecting the SSH client. Make sure to use the OpenSSH, Git default SSH Client as shown below.

Thanks goes to Chris McKee for the next part. Chris developed a plugin for Dreamweaver called ‘gitweaver’. You can download gitweaver from Chris’ GitHub repo here: https://github.com/ChrisMcKee/gitweaver. We are using Dreamweaver CS6. If you are using the same, you will need to install using the .zxp file. Go ahead and install the plugin since we will be needing it to utilize Git from within Dreamweaver.

The next thing you will need is a repository host. We love free! Go to Bitbucket and create a free account there: https://bitbucket.org/. Once you have created this account, you will be able to develop, co-develop, and maintain all of your development project repos. They can be public or private. The choice is yours. The first thing you need to ensure is that you have an identity on your system for Git to use. Open a Git Bash console window and verify that ssh is installed and available. Type in ssh –v. You should see something like this:

Now we want to set up a default identity. To do this, you will need to create a key to identify you to other systems. Do this by entering ssh-keygen You should see something like this:

Accept the default by simply pressing Enter when asked Enter file in which to save the key. You will then be asked to enter a passphrase, and again to re-enter a passphrase. This will be your password to this key file we are generating.

Now verify that you have a public and private key by entering ls –a ~/.ssh. You should see two files show up named id_rsa and id_rsa.pub.

You will now need an ssh config file. Create a new document in your .ssh folder and name it config. Inside this file, you just want 2 lines. The bottom line will purposely be indented.

Host bitbucket.org IdentityFile ~/.ssh/id_rsa It should look like this:

Once you have created this file you will need to close and re-open the Git Bash console.

Next we want to create a .bashrc file so that we can automatically start our ssh agent when we launch Bash. Windows doesn’t like creating files like this. I personally like http://notepad-plus-plus.org/” target=”_blank”>Notepad++ for tasks like this. Notepad++ is also a good utility to keep in your belt. Copy the following text to place in this new file: SSH_ENV=$HOME/.ssh/environment

start the ssh-agent

function start_agent { echo "Initializing new SSH agent…"

spawn ssh-agent

/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "$” echo succeeded chmod 600 “$” . “$” > /dev/null /usr/bin/ssh-add } if [ -f “$” ]; then . “$” > /dev/null ps -ef | grep $ | grep ssh-agent$ > /dev/null || { start_agent; } else start_agent; fi Again, you will need to close and re-open Git Bash. The difference is that this time it should ask you to enter your passphrase. Once you enter your passphrase, verify that your identity was successfully added by entering ssh-add –l. You should get a confirmation like this:

Let’s add this identity key to our Bitbucket account so we will be authorized. Go to Bitbucket and log into your account. Once logged in, click on your avatar in the top right and select Manage account. You will be taken to your account settings where a menu on the left has an option called SSH Keys. Click this option to add our key. We need to copy our key from our local system, so go to your Git Bash window and type in cat ~/.ssh/id_rsa.pub. This will spit out your key to the console window. Now click on the little icon in the console window (top left corner) and select Edit -> Mark. Drag your mouse over the key starting at ssh-rsa all the way to the end. Make sure you get the entire key. Copy this to your clipboard. Now in Bitbucket we can add our key. Click on Add key. Name this key whatever makes sense to you and paste your key into the bottom field. Click on the Add key submit button in the bottom and you are done.

You should now be able to return to your Bash console and type in ssh –T git@bitbucket.org and see a proper logged in verification like this:

Let’s go create our first repo in Bitbucket and test our setup. Inside Bitbucket, you want to click on Create repository. Enter in the following information for a simple test repo.