Mac Android studio submits a local project to Github and has configured an ssh key.
Register account https://github.com
Configure the ssh key and secret key locally
After configuration, you need it here.
Start configuring the ssh key locally. First check whether ssh is configured on the Local Computer and enter the terminal to enter $ defaults write com. apple. finder AppleShowAllFiles-bool true (show hidden files (you need to re-run the Finder) because. ssh is a hidden file ).
In the desktop menu, check whether the file. ssh hidden file exists. If yes, we recommend that you delete it.
Now, configure the ssh key locally.
Create a. ssh file on the mkdir. ssh terminal.
Cd. ssh enter the directory of the new. ssh file.
Ssh-Keygen-t rsa-C "xxxx@xxx.com" after "" enter a mailbox at will, enter will prompt you enter the password or something, you can ignore always press Enter.
Check whether id_rsa (Private Key) id_rsa.pub (Public Key) exists in ls-la.
PbcZ records? Http://www.bkjia.com/kf/ware/vc/ "target =" _ blank "class =" keylink "> vcHkgPCB + Ly5zc2gvaWRfcnNhLnB1YiAgICAgv72xtCC5q9S/fingerprint =" http://img.blog.csdn.net/20160415094650694 "alt =" here write picture description "title =" \ ">
Paste the key that you just assigned
Enter title casually
The ssh key of github is configured. Next, enter $ ssh-T git@github.com in the terminal.
If you see this, the connection is successful. The point on the left of the newly added key on github is grayed out at the beginning. After the terminal executes this command, the page is refreshed and the gray point turns green.
Project Creation
1 open the terminal, first test your account and github connected not: ssh-T git@github.com
2. Create a personal project in git
Upload a local project
First, go to the project root directory you have created on the terminal.
Run the following command:
Touch README. md // create a document for record submission
Git init // initialize the local repository
Git add README. md // add
Git add * // add all projects
Git status // check if the status is green
Git commit-m "first commit" // submit it to the repository and write some comments
Git remote add origin git@github.com: xxx/yyyy. git // xxx is your github account, for example, my account name: li4236 = yyyy is the name of the project you just created
Git push-u origin master // submit the local warehouse to the address where the address is origin, under the master Branch
So far, the local project has been submitted to github. Refresh the page and check it out.
I encountered some problems during the configuration process.
Permission denied (publickey) solution:
First, clear all key-pair
Ssh-add-D
Rm-r ~ /. Ssh
Delete your public-key in github
Restart ssh key Configuration
He authenticity of host 'github. com (192.30.252.120) 'can't be established.
RSA key fingerprint is SHA256: nthbg6kxup1_gl7e1igocspromtxdcarlvikw6e5sy8.
Are you sure you want to continue connecting (yes/no )?
Previously I had been building it by pressing return. In fact, I have to enter yes (silly x me)