publish only one folder on gitHub in a parallel branch

1

I need to make my master branch of git publish only the contents of a folder called dist in a parallel branch I'm calling SRC I'm working with angle 5 and basically what I want is that my project (source) is on one page and my ghPage (result) on another branch without the source code, first of all thank you very much!

    
asked by Bryan Pereyra 31.03.2018 в 15:57
source

1 answer

0

I hope to understand what you are asking, you want that from your branch SRC only include the branch folder dist in master, if so, the following occurs to me (it is quite simple).

Just go to your branch SRC, create a new branch to not touch the one you have:

git checkout -tb SRC-solo-dist

Then delete all the folders that do not work, basically everything except "dist", if you do a git status you will see that all the files are marked as "deleted" this clearly means that when you commit these files will disappear, so make the commit:

git add . (para agregar todos los cambios)
git commit -m "dejando solo la carpeta dist" (para hacer el commit y dejar un mensaje)

Now you have a branch as you want it in master, the next is to replace master for this branch, be careful as well because this process will break everything you have in master.

To finish you just have to do a push to master using the -f option (--force):

git push master -f

I hope it works for you.

greetings

    
answered by 04.04.2018 / 01:04
source