Branching a subdirectory while keeping commits from other directories

I currently have a single pre-existing Git repo for a client/server solution that contains three subdirectories for 3 sub-projects:

/client  - An Angular2 SPA application (client-side TypeScript) /dtos    - Language-agnostic web-service DTO (data contract) definitions written in T4     /client - T4-generated TypeScript typings *.d.ts files     /server - T4-generated C# DTO classes /server  - The web-service 

So far this is all in a single master branch, with appropriate temporary dev/ branches that are merged when their work is complete:

o--o--o--o - master  \   /   o-o      - dev/foo 

We need to do some A/B (or rather, A/B/C/D) testing on radically different UX options in the Angular2 project – I would like to branch-off for each UX option, to generate different builds we can test, then after our UX research is done we merge that specific branch back into master for the remainder of the project:

o             - master  \   o--o--o---o - ux/red-background    \     o--o----o - ux/new-sidebar         \          o--o - ux/new-sidebar-and-banner 

However I only want to branch the /Client directory off – so the /DTOs and /Server directories always contain the latest code.

In SVN and TFS this is easily doable because branches can be made from subdirectories, not just the entire repository (as they are with git), so if this were an SVN project then I would do something like this:

cd trunk  # this is the solution root with the client, dtos and server directories svn copy ^/trunk/client ^/branches/red-background svn copy ^/branches/red-background ^/branches/new-sidebar # then after some commits to 'new-sidebar'... svn copy ^/branches/new-sidebar ^/branches/new-sidebar-and-banner 

Then to build the solution with each different branch of /client we modify the symlink:

cd trunk # to 'checkout' the red-background version prior to building: ln -s branches/red-background client # or the new-sidebar version: ln -s branches/new-sidebar client 

The main advantage of this approach is that commits can continue to be made to the /dtos and /server directories without affecting client at all – regardless of whatever branch of client is being worked-in.

Whereas with git, a branch is a separate timeline entirely, so this scenario becomes impossible.

I understand that to get the result I want, I would still need to create different branches for each version to test or build, but changes to /dtos or /server would still need to happen in master (just like in trunk in SVN) but after every commit everyone working on the different client branches would need to rebase or merge from master, and that has the potential to get really ugly (especially if individual people rebase from multiple commits to /server choosing their own rebase points – they might end up with identical codebases but different commit hashes).

What’s the solution?

(Another solution is to move client to its own git repo – then merging it back into the solution repo when it’s all done – I’m not opposed to this but let’s pretend that we’ve hit our maximum repo count in our organizational GitHub account)

Rewriting URL of WordPress in a Subdirectory

I am renting some webspace and a domain from BlueHost.com on which I run a WordPress site. Let’s call it domain.com. WordPress is installed in the root folder.

As I can run multiple sites on this webspace, I installed a second WordPress site in a subdirectory: domain.com/wp2.

I furthermore own a second domain – let’s call it second.com – which is rented from nearlyfreespeech.com. I therefore created a .htaccess file which forwards all traffic from second.com to domain.com/wp2.

My problem: I can’t figure out how to rewrite the url to show “second.com” once a user has reached that WordPress site. Right now, the url changes to “domain.com/wp2” after accessing the site via “second.com”.

Many tutorials point out that a .htaccess file should be placed in the root directory of domain.com to rewrite the url. But as I already have a separate WordPress site sitting in that root directly, that doesn’t seem to work for me.

How can I therefore rewrite that url so that people who access the second WordPress site via second.com keep seeing that url?

wp-admin redirects to subdirectory after moving installation to subdirectory

I have moved a wordpress installation to a subdirectory, from var/www/html to var/www/html/wp-blog mainly to make it future proof. I have followed the instructions in the codex. My server is configured as such

  1. I have a nginx reverse proxy which directs calls to blog.mysite.com to the port 8080.
  2. Apache listens on 8080
  3. I have modified the .htaccess from what is given in the codex and it is as follows

.htaccess

<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^blog.mysite.com$   RewriteCond %{REQUEST_URI} !^/wp-blog/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$   /wp-blog/$  1 RewriteCond %{HTTP_HOST} ^blog.mysite.com$   RewriteRule ^(/)?$   wp-blog/index.php [L]  </IfModule> 

I have only changed the ^(www.)? test to blog since I don’t want www. Also although the wordpress instance is in a subfolder I would like to server it via blog.mysite.com and the admin at blog.mysite.com/wp-admin.

Now my trouble is that when I use the the url blog.mysite.com/wp-admin it takes me a the login page but I get stuck in a loop after that. I noticed that my url in the address bar has a redirect_to set at blog.mysite.com/wp-blog/wp-admin. If I remove wp-blog from the redirect url, I am able to login.

The weird part is that, if the session gets over while I am in the admin page, the redirect url is fine!

At this point I have changed the WordPress URL in the General Settings to blog.mysite.com/wp-blog and everything works as far as I see. But as I said before I would like to use the admin panel on the root.