Adding an existing project to GitHub using the command line

Step for existing project to GitHub using command line, following steps are required to this.

Step 1: Creating an account to the GitHub. Suppose
Username for GitHub: myGitUser
Password for GitHub: myGitPassword

https://github.com/myGitUser/

Step 2: Access above url using mention username and password.

Step 3: Create New Repository to your account. To avoid errors, do not initialize the new repository with README. You can add these files after your project has been pushed to GitHub.

Suppose your repository name: myRepository

https://github.com/myGitUser/myRepository

Step 4: Installing GitBash to you machine. for this link http://git-scm.com/download/win

Step 5: After installing GitBash open the command prompt for Git.

GitShell

Step 6: In the Command prompt, change the current working directory to your local project.

Step 7: Initialize the local directory as a Git repository. As follows

git-init

Step 8: Add the files in your new local repository. This stages them for the first commit.

git-add

Step 9: Commit the files that you’ve staged in your local repository.

git-commit

Commits the tracked changes and prepares them to be pushed to a remote repository

Step 10: At the top of your GitHub repository’s Quick Setup page, click to copy the remote repository URL

https://github.com/myGitUser/myRepository.git

Step 11: In the Command prompt, add the URL for the remote repository where your local repository will be pushed

git-remote

# Sets the new remote

Step 12: Push the changes in your local repository to GitHub.

git-push

# Pushes the changes in your local repository up to the remote repository you specified as the origin

 

Next