Join Shaun Wassell for an in-depth discussion in this video Pushing code to GitHub, part of React: Creating and Hosting a Full-Stack Site.
- [Instructor] So now that we have our app set up for release, we have to get all the code And the way we're going to do this is by creating an empty Git repository, So to start off, as a Git repo. And to do this, let's make sure we're in the my-blog back end folder, and then run git init, and press enter. And now we get a message saying that it initialized an empty Git repository. And now, if we run git status, we can see all of our code that has yet to be committed to our Git repository. But before we commit anything, inside our my-blog back end folder, we want to create a new file, and we'll call that .gitignore. And inside this file, we want to type node_modules and hit save, and what this does is it prevents Git from adding our Node modules to the Git repository. This is essential since the Node modules folder is usually quite large, and we can just run npm install on our server once we have all the code, and it'll install the modules for us. So now that we have our gitignore set up, all we have to do is type git add, in our current directory, and hit enter. And if we do git status now, we see that all of our files are about to committed. In order to actually commit them, we just have to type git commit -m, We'll just do "First commit". Now that we've done that, we have to go to our GitHub account, and create a new repository here. This will be the repository that we push our code up to. For the repository name, we'll just call it my-blog, and then we'll leave the rest of the default settings. Let's click Create repository, and then GitHub takes us And what we're going to do is copy these two commands and run these two commands. And now if we go back to the code of my-blog, we see that our files are all there now. There's instructions on how to do that on GitHub's website. And that's all there is to it. Now we just have to create a server on Amazon Web Services, and clone this code. We'll see how to do that in a minute.
- Creating the app component
- Using React-Router links
- Setting up an Express server
- Route parameters in Express
- Adding the comments functionality
- Installing and adding MongoDB to your project
- Rewriting the endpoints
- Adding React hooks
- Adding buttons and forms
- Pushing code to GitHub
- Running a full-stack app on AWS