How to integrate Git with Dreamweaver

Updated: 02/27/2019 by Computer Hope

Dreamweaver and Git logos.Adobe Dreamweaver features Git integration, allowing you to edit files and manage version control in one application, with a unified interface.

When you associate a Dreamweaver Site with a Git repository, you can use Dreamweaver as your Git client - you can pull and push changes, write commit messages, view diffs, and perform merges. You can still use other Git clients, such as Git GUI or the git command, and Dreamweaver will cooperate with them seamlessly. If you perform Git operations on your local repository with another client, Dreamweaver will detect the updates and automatically update Git status in Dreamweaver.

Follow these steps to associate a Dreamweaver Site with a Git repository. In these examples, the Git server is GitHub.

Configure Dreamweaver to use Git

Note

These instructions cover git configuration for a new Dreamweaver Site. If you have an existing Dreamweaver Site, the steps are slightly different, and Dreamweaver is a little more picky about what configurations it will accept. Those steps are similar, but not covered here.

Creating a new Dreamweaver Site

  1. Open Dreamweaver.
  2. In the Site menu, choose New Site.
  3. Enter a Site Name. For example, enter mysite-git.

Creating a new local site folder

  1. For local site folder, select an empty folder. If you type the name of a folder that doesn't exist, it will be created. When the site is created, the remote Git repository will be cloned to this directory.

Configuring Git credentials

  1. Select Associate a Git repository with this site.
  2. Select Clone existing Git repository using URL.
  3. Enter the https:// URL of your repository.
  4. For Git Username, enter your GitHub username.
  5. For Password, if you are using 2FA (two-factor authentication), enter your personal access token (see below). If you are not using 2FA, enter your normal Git password.

Screenshot: Configuring Git association in a new Dreamweaver Site.

  1. Click Test to verify that the authentication is working.
  2. Check the box labeled Save Credentials.
Note

If you don't save your credentials now, you might not be able to do it later.

  1. Click Save.

The remote GitHub repository is cloned to your local site folder. Now, when you edit any of these files, you can use Dreamweaver as your Git client.

Generate a personal access token for GitHub 2FA

  1. In a web browser, log in to your GitHub account.
  2. Verify your e-mail address, if you have not already done so.
  3. Click your account icon in the upper-right corner of any GitHub page. From the menu, choose Settings.
  4. On the left, click Developer Settings.
  5. On the left, click Personal Access Tokens.
  6. Click Generate New Token.
  7. For Token Description, enter anything.
  8. For Scopes, you can use the default options. Make sure Repo and its sub-options are checked.
  9. Click Generate Token to invalidate any previous tokens you have generated and create a new token. Copy and paste the new token into the private document. This token can never be seen in GitHub again, so save it somewhere safe.

This token must now be used as the password for all GitHub operations that use an https:// URL, including Dreamweaver integration.

Git workflow in Dreamweaver

The following is the general workflow you should use when editing a Git-associated Dreamweaver Site.

  1. If the Git window in your Dreamweaver interface is hidden, in the Window menu, select Git. (You can toggle the side menus, including the Git menu, by pressing F4.)
  2. Before editing files, perform a Git Pull. A pull will sync your local repository, so you have all new work done by other people since your last pull.

Screenshot: Dreamweaver Git Pull button.

  1. Before you save changes to a file, Dreamweaver shows "Nothing to commit, the working directory is clean."
  2. After you save changes to a file, it's listed as an unstaged file. Unstaged files are not being tracked by Git, and will not be part of a commit.
  3. To stage a file that you have modified, check the box next to the file name. The command-line equivalent is git add filename.

Screenshot: Check the box next to a file name to stage it.

  1. Optional: If you want to unstage a file, so your changes are not included in a commit, uncheck the box next to the file name. The command-line equivalent is git reset HEAD filename.
  2. When you are ready to commit your changes, click the Commit button.

Screenshot: Dreamweaver git commit.

  1. Enter a commit message, briefly describing the changes in this group of files. This message is equivalent to the command git commit -m "message". Click OK.

Screenshot: Dreamweaver git commit message.

  1. You may be asked to enter your Git User Details. Enter the full name and e-mail address that will identify you in commit messages. You should only be asked for this information once. The command-line equivalents are git config --global user.name "Full Name", and git config --global user.email "address".
  2. When you are ready to push your commit to the remote repository, click Git Push.
  3. Unless you have a reason to do otherwise, you can use the default push settings. Click OK. The command-line equivalent is git push origin master.

Screenshot: Dreamweaver git push.

Note

If someone else changed one of the files in your commit since the last time you pulled, you will be notified that the conflicts need to be merged. In many cases, the changes can be merged automatically. When the merge is complete, you can try to push your commit again.

Troubleshooting

  • If your Git window shows no information at all, your site may be improperly configured. Remove the Dreamweaver Site, delete the local site folder (or choose a new one), and start over.
  • If Dreamweaver hangs when you first try to test your git credentials, it may be blocked by Windows Defender firewall. To reset Dreamweaver's firewall settings, reinstall Dreamweaver and make sure to grant firewall access the first time you start the application.
  • If Git doesn't seem to be working properly with Dreamweaver, you can try reinstalling Git. Dreamweaver uses the Git command line tools under the hood, and you might have stale login information or another configuration. If so, reinstalling Git should reset this info and resolve the issue.

Additional information