The Ionic branch
have all Ionic
related files/folder. The front-end
is created here to serve mobiles and web devices. But the code for web devices from this branch is not hosted anywhere.
The Node branch
have server
related files/folder. This branch will be uploaded to host the application end-points and will need to serve a public front-end folder. The front-end folder comes from the Ionic branch.
I've read this post about spliting a commit into separate commits, so we can ignore one of them. This don't solve the problem because I have lots of files and folders that should not merge and would be very hard to separate them all in each and every merge. I need only the front-end/public/www
folder to merge into the Node branch.
I also read about this, this, this and a lot more relevant questions on Stack and articles on the internet, but none of them could address my issue.
Appendixes
Branch Node example:
¬ node_modules
¬ routes
¬ www
¬ files/etc
Ionic Node example:
¬ node_modules //this should not merge into Node
¬ hooks //this should not merge into Node
¬ resources //this should not merge into Node
¬ www //MERGE THIS
¬ files/etc //some should merge, some should not.
All repositories in a project can inherit or override the branching model, including automatic branch merging. To enable automatic branch merging for all repositories in a project (requires project admin permission): Go to Project settings > Branches. Under Automatic merging, select the On status and then select Save.
Get the commit git cherry-pick -n <commit> Unstage everything git reset HEAD Stage the modifications you want to keep git add <path> Make the work tree match the index # (do this from the top level of the repo) git checkout . Done!
CONFLICT (content): Merge conflict in <fileName> Automatic merge failed; fix conflicts and then commit the result. This type of conflict can be resolved either by manually fixing all the merge conflict for each file OR using git reset ––hard (resets repository in order to back out of merge conflict situation).
This is from top of my head so it is only an idea to try out.
If I understand correctly you want to selectivly merge ionic
onto node
git checkout node
git checkout -b temp
git checkout -p ionic -- www
# solve merge conflicts
# git add or git add -p (interactive per diff adding)
git checkout -p ionic -- files/etc
git checkout -p
and git add -p
should give you interactive option of adding and checking out paths/files/parts of files.
git checkout --help
-p --patch Interactively select hunks in the difference between the (or the index, if unspecified) and the working tree. The chosen hunks are then applied in reverse to the working tree (and if a was specified, the index).This means that you can use git checkout -p to selectively discard edits from your current working tree. See the “Interactive Mode” section of git-add(1) to learn how to operate the --patch mode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With