Skip to content

Recommended Steps for Merging Starter into Existing Project

Anthony edited this page Sep 25, 2016 · 9 revisions

Recommended Steps for Merging Starter into Existing Project

1. Create a new branch

git branch merge-with-starter  
git checkout merge-with-starter

2. Add this starter as a remote source

git remote add starter https://github.com/qdouble/angular2webpack2-starter.git

3. Fetch Starter repo

git fetch starter

4. Merge with starter project

git merge starter/master

5. Add files that can’t be accessed

git add *  
git add .gitignore

6. Carefully examine merged files for conflicts.

Original files will be under


<<<<<<< HEAD
=======


Files from starter will be within

=======

=======
>>>>>>> starter/master

You generally want to copy the stuff that you want to keep from the HEAD section and paste it into the starter/master section and then delete the HEAD section. Keep or move entries that you want to keep, delete stuff that’s not needed and save changes.

7. Make sure to move main application declarations, imports, providers and to APP_DECLARATIONS, APP_IMPORTS and APP_PROVIDERS files in src/app

8. Stage the files you have fixed

git add *  
git add .gitignore



9. Clear and install packages

delete node_modules folder and then run npm install

10. Examine app for conflicts. Try to run app in different modes (development/production, JIT, AOT, Universal)), run tests and resolve any issues.

11. Cleanup and remove any files that are no longer needed.

12. Save changes and commit.

git add *  
git commit
:wq

13. Merge your updated app into master or send pull request

14. Enjoy your updated app 😄 .

*If you’re using Universal and have routes with html5pushstate, be sure to add the main routes for Universal to use in the ‘src/server.routes’ file.

Clone this wiki locally