Find us on facebook

Jun 2, 2015

Adding an existing project to GitHub

Initialize the local directory as a Git repository.
git init

Add the files in your new local repository. This stages them for the first commit.
git add .

Commit the files that you've staged in your local repository.
git commit -m 'First commit'

In the Command prompt, add the URL for the remote repository where your local repository will be pushed.
git remote add origin https://ishara@bitbucket.org/ishara/weatherapp.git
# Sets the new remote
git remote -v
# Verifies the new remote URL

GitHub for Windows users should use the command git remote set-url origin instead of git remote add origin here.

git push origin master

No comments:

Post a Comment