Step one: Add Keys to GitHub
To generate a local key:
$ ssh-keygen-t rsa-c "[Email protected]"
When the command executes, it prompts for the location of the generated. SSH folder, enters the open id_rsa.pub file, and copies all of the contents.
Add encryption Key:
Go back to GitHub, enter settings under your avatar, enter ssh,new ssh key, fill in the title, and paste the copied key.
Step Two: Local project upload:
1. Execute git init under project ROOT to convert the project into a Git project (Add. Git folder in the project).
2. Configure the submitted user name and mail address in the project root directory:
git config--global user.name "yourname" git config--global user.email "[Email protected]"
3. Execute under Project root (Create new new repository on GitHub, named Project):
Git remote add Origin https://github.com/yourname/Project.git
After executing the command, add the following to the. git/config file:
[Remote "origin"]url = Https://github.com/yourname/Project.gitfetch = +refs/heads/*:refs/remotes/origin/*
4. Execute the submission process:
git Add. Git commit-m "first commit" Git push origin Master (need to add parameters, follow direct git push)
After executing the. git/config file, add the following:
[branch "master"] Remote = origin merge = Refs/heads/master
Upload completed
Uploading a local project to GitHub