First right-click git bash here at the location of the project file
Create ssh key locally
$ ssh-keygen -t rsa -C "[email protected]"
To verify success, enter under git bash:
$ ssh -T [email protected]
Find the .pub file in the local Users/BEAR/.ssh and copy the key to github-setting-key.. New inside
Set username and email, because github records them every commit.
$ git config --global user.name "your name" $ git config --global user.email "[email protected]"
Initialize git:
$ git init
Add the files that need to be added to git:
$ git add .
Submit the code to the local directory:
$ git commit -m "first upload"
Enter the repository to be uploaded to add the remote address:
$ git remote add origin [email protected]:yourName/yourRepo.git
Push Changes
Your changes are now in the HEAD of the local repository. Execute the following command to commit these changes to the remote repository:
$ git push origin master
OK!!