How to create a GitHub remote repository
First of all, you have to go to the GitHub website to register your account https://github.com
Then create a project that creates a new repository
After you fill in the repository name with the Zxtabbarcontroller (your remote repository name), the others remain the default settings,
By clicking the "Create Repository" button, you have successfully created a new git repository:
Open terminal to enter your file directory
Ssh-keygen " [email protected] "
Instead, you will be asked to confirm the path and enter the password after you have registered on GitHub, we use the default one-way carriage return.
Successful words will be generated under the ~/. SSH folder,
Go in, open the Id_rsa.pub, copy the key inside.
VI /users/jackey/. SSH
Copy all of the contents and then go back to the GitHub page to select setting
Select SSH and GPG keys after entering settings
Select New SSH Key
After entering title and key, select the Add SSH Key button to complete the add
Now go back to the terminal and test if you can connect to the GitHub server
ssh -t [email protected]
See this tip to show that it's set up.
ssh -T [email protected]hi zhouxihi! You'vesuccessfully authenticated, but GitHub does not provide shell access.
You can then push the local file to the remote repository.
Initialize the local repository first
Git init
Add File
git Add.
Write Cache
' First upload '
Add a remote repository
git remote add origin [email protected]:zhouxihi/zxtabbarcontroller.git
Push files to remote repositories
Git push-u Origin Master
Display 100%. Yes, that's it.
Bogon:zxtabbarcontroller jackey$ git push-u Origin mastercounting objects: $, Done. Delta compression using up to4threads.compressing objects: -% (Wuyi/Wuyi), Done. Writing objects: -% ( $/ $),86.20KiB |0BYTES/S, Done. Total $(Delta -), reused0(Delta0) remote:resolving Deltas: -% ( -/ -), Done. to [email Protected]:zhouxihi/Zxtabbarcontroller.git* [New branch] Master,Masterbranch Master set up to track remote branch master from Origin.
Each time you have to modify the local file, as long as the following three steps can be pushed to the server
->git Add.
->git commit-m ' second upload '
->git Push-u Origin Master
If you want to pull down from the server, you can use the command
git clone https://github.com/zhouxihi/zxtabbarcontroller.git
Create a GitHub remote repository