How to create a GitHub account and Learn how to push your code to GitHub Repository?

Let’s create Git repository for our node application.

Around the globe, centralized version control systems like SVN, CVS are replaced by distributed version control system like Git and Mercurial Since Distributed version control system has many advantages when compared with CVCS. Centralized version control System just used to backup, synchronize and track files however distributed version control system helps to share the changes. Want to know more about its different check out this link.

Let’s sign up into Github account for which we might need a username and valid email Id. Hit this link https://github.com/ in your browser.

Once Sign up completed, you can able to see above the screen. You will be asked to choose your plan, for now, I’m creating public repositories. If you don’t want to share your code with other users you can prefer private repositories so that your code will be secured from other users.

Meantime check your mailbox, you might have received an activation email, just click the link available in your email. That’s it you have successfully created GitHub account.

Once an account is created successfully, Now we will create the new repository to store our code and I’m creating a new repository with name node app.

While creating a new repository, You can make it as private however you need to afford charges associated with it. The second check box will just create a readme file for us, we can describe our application details in it. Once the repository is created then you can find below page.

Great, you have created the new nodeapp repository for our application. Click the clone or download button available, then you can find our application HTTP git URL. Git supports multiple protocol HTTP, ssh, and file protocol, however, we are going to concentrate only about HTTP protocol.

In GitHub, we have successfully created our application. Now we will make our nodeapp folder into a GitHub project.

Open git bash or terminal in your system and change directory to nodeapp.

Executing git status command will return some details, great we have created our git application. Here we need to create .gitignore files. In the .gitignore file, we can enter files or folder names which we don’t want to push it to the git repository.

nodeapp Raghu$ cat .gitignore
node_modules

Here I have just added node_modules, I’m not going to push node_modules into our git repository. Now, Let’s run git status command.