Adding an Existing project to GitHub
- Create a new repository(repo) on GitHub.
- In command prompt open Git Bash
- Change the current working directory to your local project.
- Initialize the local directory as a Git repository.
git init
- Add (stage) the files in your new local repository.
git add .
- Commit staged files locally.
git commit -m "initial commit"
- In GitHub copy the https url of your newly created repo (e.g https://github.com/xxxxxxx.git)
- In the command prompt, add the URL for the remote repository where your local repository will be pushed.
https://github.com/xxxxxxx.git
git remote add origin
git remote -v
- Push the changes in your local repository to GitHub.
git push -f origin master