Pushing your first project on Github

GitHub is a United States-based global company that provides hosting for software development version control using Git.

Git:- Git is a version control system that lets you manage and keep track of your source code history.

GitHub:- GitHub is the cloud-based hosting service that lets you manage Git repositories.

There are some basic steps to push the first project on GitHub, which are given below.

Now that you have Git on your system, you’ll want to do a few things to customize your Git environment. You should have to do these things only once on any given computer.

$ git config --global user.name "rajputankit22"
$ git config --global user.email rajputankit22@gmail.com

If you want to check your configuration settings, you can use the git config --list command to list all the settings Git can find at that point:

$ git config --list

After setup git on our system, Login in your github.com and create a new public or private repository.

Firstly enter in your project’s root directory. Now we will initiate repository by the following command.

$ git init

The git add command adds a change in the working directory to the staging area. It tells Git that you want to include updates to a particular file in the next commit.

$ git add .      // . means add all files

The commit command is used to save your changes to the local repository.

$ git commit -m "first commit"   // -m for the message

To add a new remote, use the git remote add command on the terminal, in the directory your repository is stored at.

$ git remote add origin https://github.com/rajputankit22/firstrepo.git

The git push command is used to upload local repository content to a remote repository.

$ git push -u origin master

Now your code is saved in GitHub, you can share, access and collaborate with anybody through the username.

I’m a MERN Developer. ( Redux | AWS | Python ) I enjoy taking on new things, building skills, and sharing what I’ve learned.