• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Using Dreamweaver with WordPress and git

Community Beginner ,
Apr 19, 2018 Apr 19, 2018

Copy link to clipboard

Copied

I think setting up Dreamweaver with git or WordPress is pretty straightforward. What is confusing me is setting up Dreamweaver with Wordpress and git. For WordPress developers, we generally only create git repos for the theme or the themes folder. When I associate a git repo to my staging (test) and production (remote) server, Dreamweaver is confused because the git folder hiearchy does not show the entire WordPress folder.

Does anyone know how to set DreamWeaver to deal with git only on the themes folder and understand that the root WordPress installation is a few levels above?

Views

2.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 19, 2018 Apr 19, 2018

Copy link to clipboard

Copied

See Ignoring files - User Documentation

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 20, 2018 Apr 20, 2018

Copy link to clipboard

Copied

I'm looking for a solution where I don't have to commit the entire WordPress core directory structure.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 21, 2018 Apr 21, 2018

Copy link to clipboard

Copied

What's wrong with using gitignore as per the article? This is an example to help you .gitignore file for WordPress - Bare Minimum Git · GitHub

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 22, 2018 Apr 22, 2018

Copy link to clipboard

Copied

There's nothing wrong with your answer. I'm sure it's helpful to people who don't have the requirement I was looking for. To reiterate, I'm trying to find a solution where there's no need to commit the root directory of WordPress core. For context, there are already themes that I've developed and continually work on that I'd rather not refactor (even if it is "not that big of a deal") so I can keep a specific workflow.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 23, 2018 Apr 23, 2018

Copy link to clipboard

Copied

I must admit that I don't quite understand what type of functionnalities , and workflow, that you are looking for...

question when working on WP

  • are you working alone on the template/plugin,
  • are you working only on template OR plugin but not on both,

when you work on a template where are you storing the evntual shortcode, or plugin linked to the template ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 19, 2018 Sep 19, 2018

Copy link to clipboard

Copied

I would also love to find a solution for this. I've been trying to figure out how to use Dreamweaver and Git for  Wordpress plugin and theme development purposes ever since Git support was introduced in Dreamweaver and I haven't figured it out yet.

I think what the original author is asking is how to specify a git repository only for a specific folder(s) in a Dreamweaver site.

Typically, for every (Wordpress) site I define in Dreamweaver, it is defined at the root of the Wordpress installation. This is so that if I modify and upload any files, it will place them in the appropriate folder on the remote server.

Normally, the files that would be modified are either theme related or plugin related, or both. For versioning purposes, I only need specific folders to be tracked and not the entire Wordpress installation. So if I have only one theme and one plugin that need versioning and 20 others that do not need versioning, I surely do not want for all plugins to be committed, on top of the entire Wordpress core.

I understand that there's a workaround using the .gitignore file (which I haven't tried yet) but that doesn't quite make sense since I do not want to have to manage the .gitignore file every time I "get" a folder from the remote server for a plugin or theme that I do not need to modify (which I often need to do in order to look through the code and how things are done to implement in my custom plugin or theme).

Any ideas on this will be greatly appreciated.

Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 19, 2018 Sep 19, 2018

Copy link to clipboard

Copied

im10er I think I may have found a solution here: git - Using .gitignore to ignore everything but specific directories - Stack Overflow

The idea is to make use of the .gitignore file to ignore everything (specific to Wordpress file structure) but the specific folders you want.

I think this approach is much more practical than the previously mentioned .gitignore approach.

Here is the specific .gitignore file contents I am referring to:

# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
# content. Or see git's documentation for more info on .gitignore files:
# http://kernel.org/pub/software/scm/git/docs/gitignore.html

# Ignore everything in the root except the "wp-content" directory.
/*
!.gitignore
!wp-content/

# Ignore everything in the "wp-content" directory, except the "plugins"
# and "themes" directories.
wp-content/*
!wp-content/plugins/
!wp-content/themes/

# Ignore everything in the "plugins" directory, except the plugins you
# specify (see the commented-out examples for hints on how to do this.)
wp-content/plugins/*
# !wp-content/plugins/my-single-file-plugin.php
# !wp-content/plugins/my-directory-plugin/

# Ignore everything in the "themes" directory, except the themes you
# specify (see the commented-out example for a hint on how to do this.)
wp-content/themes/*
# !wp-content/themes/my-theme/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 19, 2018 Sep 19, 2018

Copy link to clipboard

Copied

it was the solution that Ben proposed (feedback 1 and 3) and that OP had not validated (feedback 4)... so I was looking to better understand the needs and especially the workflow used ... but the OP didn't show up anymore?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 20, 2018 Sep 20, 2018

Copy link to clipboard

Copied

@Birnou I understand that Ben suggested using a .gitignore file, however it wasn't specific enough to the scenario described by the OP to actually offer a solution. I checked feedback 1 and 3 and although they both suggest the use of a .gitignore file, none actually provide a direct solution.

Feedback 3 link was getting close to a solution but was too broad - it was leaving in all plugins and themes which in some cases can be numerous and unnecessary.

As for the workflow used, I have detailed some of it, but to answer your specific questions:

- When working with Wordpress themes and plugins, one usually will work with both themes and plugins, depending on the project. Either way, the solution should be flexible enough to allow for either.

- Themes are stored in /wp-content/themes/themename and plugins in /wp-content/plugins/pluginname

I have implemented the .gitignore file as per the article I linked to above and the contents of which I also pasted in and it does exactly what I needed and what I think the OP was looking for: to ignore everything but specific folders that correspond to theme and/or plugins you specifically want to work with.

This has the effect that in the Git window in Dreamweaver you will now only see information about the files in the theme and plugin specified to NOT be ignored in the .gitignore file, thus providing a much cleaner (and more logical) experience - instead of seeing thousands of Untracked files that nobody cares about.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 20, 2018 Sep 20, 2018

Copy link to clipboard

Copied

I'm sorry, but Ben's answer 3 corresponded to my opinion to the right answer... answer that was not accepted by the OP... now speaking in place of the OP is expectation

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 21, 2018 Sep 21, 2018

Copy link to clipboard

Copied

I am not sure how you can qualify any answer as the right answer given that you didn't seem to undertand the OP's needs and workflow. Anyhow, my issue has been solved as per my previous reply.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 21, 2018 Sep 21, 2018

Copy link to clipboard

Copied

LATEST

I didn't qualify the answer as correct, I just specified that in my opinion indicating to the OP that to filter the files to be gittered or not happens through the.gitignore file... that's all... now only the OP could indicate what is or is not correct in its own context and in the sense of its own question.

as for understanding the workflow used by the OP... I still haven't understood it... he wants to filter files and folders, but considers that the solution provided by Ben doesn't match him?.... so I was waiting for more details on this subject?

the you told us that you've found a solution to the question you asked yourself... I'm happy for you

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines