Login github with your account. Settings->SSH and GPG keys->New SSH key Fill out the form (title and your public key)
Test your SSH connection with following line. If the SSH key is successfully connected, the icon of the key will become green.
ssh -T git@github.com
New Project with github
Register the github account.
New repositories in the github.
Adding an existing project to GitHub
Initialize the 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 .# Adds the files in the local repository and stages them for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'.
Commit the files that you've staged in your local repository.
git commit -m "First commit"# Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.
At the top of your GitHub repository's Quick Setup page, click to copy the remote repository URL.ill
In Terminal, add the URL for the remote repository where your local repository will be pushed.
git remote add origin remote repository URL# Sets the new remotegit remote -v# Verifies the new remote URL
Push the changes in your local repository to GitHub.
git push -u origin master# Pushes the changes in your local repository up to the remote repository you specified as the origin
TroubleShooting
If you cannot push the code, it probably be the README.md were not in your directory. Solution: Before push your code, use the following line.
Configure github with mac and upload an existing project to github by using terminal
Configure ssh with public keyOpen Terminal.Create a new ssh key (change with your email address)ssh-keygen -t rsa -b 4096 -C "your_email@example.com"Login github with your account. Setti