Follow the steps to Push/Upload our project to Github using Command line.
-
Create a new repository on GitHub. You can also add a gitignore file, a readme and a licence if you want
-
Open command prompt / Git Bash / terminal
-
Change the current directory to your local working project.
-
Initialize the local directory as a Git repository.
git init -
Add the files in your new local repository. This stages them for the first/initial commit.
git add . -
Commit the files that you’ve staged in your local repository with short message.
git commit -m "initial commit" -
Copy the https url of your newly created repository from Github
-
In the Command prompt, add the URL for the remote repository where your local repository will be pushed.
git remote add origin URL_OF_REPO -
Verifies the new remote URL
git remote -v -
Push the changes in your local repository to GitHub.
git push origin master
** Note : For Pushing any changes to the repo/project, you just need to follow step 5, 6 and 10.**
That’s all
