As am trying to learn node JS, I've learnt that we need a lot of packages to run a web application. Like any web app we would want to push (store) this code in Github. No one wants to have all the projects present in our local machine. Storing data in Github applications will help us to access the code from any where any system. Also we get to choose if we want this application to be public/private
In a simple application we would be requiring so many packages
eg
As we can see they are so many packages and ideally we don't require all this code to be uploaded in Github. As long we have uploaded package.json we can always download these files by using the following command i.e. npm -i install once we download the project from github
While uploading the project to github we need to create .gitignore file and enter the filenames which we want not to be uploaded ".gitignore" file is a hidden file
For ignoring the node modules enter the following directory
Then next steps are similar github upload
- Creating repository in github
- Then in local machine enter the following commands git init
- git add .
- git commit -m "version name"
- git remote add origin https://github.com/githubusername/projectname.git
- git push -u origin master
Comments
Post a Comment