I have a master and want to have several "outputs" How do I accomplish this. I've no clue if this is possible with Git.
Please have a look at this example git project:
Master
- phpfiles.php
- config.php
- plugins
- a.php
- b.php
- c.php
Branch A
- phpfiles.php
- config.php -> is different then the Master
- plugins
- a.php
Branch B
- subfolder1
- subfolder2*
- phpfiles.php
- config.php -> is different then the Master
- plugins
- c.php
Please note that subfolder2* contains "Master" with additions...
When I change something in phpfiles.php in the Master For instance on my local machine I go to Master/phpfiles.php make a change then apply these commands in terminal:
git status (optional)
git checkout master (optional?)
git add . -A
git commit -m "Made a change"
git push
For Branch A: I go into that folder on the webserver and or local machine:
git checkout Branch A
git pull origin master
--
For Branch B: I go into that folder on the webserver and or local machine:
git checkout Branch B
git pull origin master
Is this the correct workaround to accomplish this? Any help is much appreciated!
--
My steps are:
I've done this, from scratch, created new folder:
git init
git remote add origin https://**@bitbucket.org/*/*.git
git fetch && git checkout BranchB
git merge --strategy=ours origin/master
->I get: Already up-to-date.
ls
->I get:
subfolder1
subfolder2
I'll then try to "get" the changed file manually from master which needs to go in subfolder2 so:
git checkout origin/master -- changed.php
ls
-> I get:
-subfolder1
-subfolder2
-changed.php