How to – add an existing project to GitHub through command line


Sharing for quick reference !

  • Create a new repository in GitHub and copy its URL.

https://github.com/new

  • Go to the project folder and run git init command to initialize the local directory as Git repository. Download Git for Windows

git init

  • Add the files to this new local repository

git add .


  • Commit the files to the local repository

     

    git commit -m “my first commit”

  • Specify the URL of the remote repository and set the new remote

git remote add origin URL

git remote -v

  • Push the changes to GitHub

git push origin master

Get all the details here

https://git-scm.com/videos

https://git-scm.com/book/en/v2

Hope it helps..

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

One thought on “How to – add an existing project to GitHub through command line”

Please share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.