第一次往github上传文件步骤

第一次往github上传文件步骤:

  1> 从右上角 '+' 位置下拉菜单中,创建一个repository

  2>从右上角头像位置下拉菜单 setting中设置 SSH keys  

  3>打开终端  跳进apple文件夹,输入  ~/.ssh   如下图

  4>r然后输入   ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

  5>回车输入两次 简单的密码

      • 计算机生成了可选文字:
apple—3:•. am•e$ cd •v/.ssh 
apple—3: .ssh apple$ 
apple—3: .ssh apple$ ssh—keygen —t rsa 
.ssh — 
bash — 80*24 
—b 4ø96 —C "liufan321@gmail. com" 
Generating put)lic/prlva e rsa ey pal r. 
Enter file in 4Hhich to save the key ('Users/apple/. 
Enter passphreg;e (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/apple/.ssh/id_rsa. 
Your public key saved in /Users/apple/.ssh/id_rsa.pub. 
The key Ingerprint is: 
liufan321@gmai1.com 
The key's randomart image is: 
RSA 4Ø961 
1.00. O 
apple$ cat r' 
apple—3: . ssh

  6>输入  cat id_rsa.pub 会显示许多行base64加密的代码

  7> 回到第2步打开的setting网页 选择add ssh keys   base64加密的代码粘贴进去

        计算机生成了可选文字:
Search GitHub 
Personal settings 
Profile 
Account settings 
Emails 
Notification center 
Billing 
SSH keys 
Security 
Applications 
Personal access tokens 
Repositories 
Organizations 
Pull requests 
Issues 
Gist 
Need help? Check out our guide to generating SSH keys or troubleshoot common SSH Problems 
SSH keys 
This is a list of SSH keys associated with your account. Remove any keys that you do not recognize. 
news 
Added on Oct 25, 2015 — Never used 
Add an SSH key 
Title 
hello 
Key 
ssh-rsa 
Add SSH key 
Delete 
AAAAB3NzaC1yc2EAAAADAQABAAACAQDqYvj5vKN2jHyk2/xk09P2Leqs7vu8hwNpSivU7/anv86MsBSdJURlQR9mJ 
flFtXmplcXAiUdYoOFFlefAlUxk51RbDnQkD/YxE9WHF2mqtVY25ZVdJL4g1dlLGjlRTtt1fqVZj4V4cHeulPqHnMsOAzMt9i 
EvAm2EYbF2jcZ4+otOq21ZBKN 1 vV111jBVEF67KmHHSoriDVb2ZP011+PZv19dva8UoxL 
pT18VwQJ8eRqsÆ'iEJfr&lQ54rABRSEjOjNOaaWRYJ5m106B06KvBQR5EBcGpf648eny1 RK+lLDElnzdMDz5t+JE3 
Yd/3dyZcCh2cmOd1 YH/S9LSqZMh3h+wUGpzz2KlsBlSJzM70a4iMtW46POh+6stZGlqas8kHAB2MjQPEcwglwPHzbym 
bWrBPxmGLAOZXDH+oJL9hr2YlaggT3nG4QDyOVuHAHDOp1 bN05qHeoQ8NVHOHE/sffwxEG85wYama963Df6vtglQo 
Wk5zeUY7uHwEiCugxocu IJn1 V3gjrzGL15vgW7eyp6Mnt1 mvtU IRUOiebQH4LUOvaCqj/9ZnC+/CoNCZ+1 FqrOGkG+F 
NTxNclSas23TKD4X82TqEy4bsEvOAr9gjzFfLmceWkhpWGTomS+ag6H+hAeUn/P101 HjyG3ZWQ:: 
546017410@qq.com 
Add key

  • 8>点左上猫头如下图1.  然后点击你最新创建的repository
      •   

  9> 复制克隆地址

      • 计算机生成了可选文字:
This repository Search 
jyq52787 / NeteaseNews 
Edit 
G) 1 commit 
Pull requests 
Issues 
Gist 
contributor 
Latest commit 3a8bd1f 26 days ago 
26 days ago 
26 days ago 
26 days ago 
V 1 branch 
O Code 
(D Issues 
Pull requests 
EE Wiki 
pulse 
lulL Graphs 
Settings 
SSH 
clone URL 
git@github.com : jyq 
n clone with H 
SSH, r Subversion. O 
T.ssh 
Clone in Desktop 
Q Download ZIP 
releases 
Branch: master NeteaseNews / + 
jyq52787 Initial commit 
.gitignore 
LICENSE 
README.md 
README.md 
NeteaseNews 
Initial commit 
Initial commit 
Initial commit

  10>.克隆项目到本地

   计算机生成了可选文字:
é Shell 
O Downloads 
13 
Desktop 
apple 
apple (3) 
Macintosh HD 
1.61152— 
07kNSUR...on+WebView 
Networking 
_Store 
Attention 
Star o 
ssh 
one 6 - iPhone 6/ iOS 9.3... 
apple 
a. 
x; 
nwatch 1 
HTTPS I iOS 
gox24 
01k 
02k 
04k 
.DS_Store 
WWDC 
hk76nBaød9sbAuLVraenqTøsJP1k9v+sTeh8ZpLaL 
ITxrAx35VvYBp17P5u/ZDChUq3HbDzvck1XDR09DD 
86A8DOxxD6iEPbbPVe1gq/5DOqØxUK8j rpRNtKuu8 
k6KOs3ag2bnBqJMiDRFs65yjdv5aii5KpjVQ3qo/4 
DvgØAJ8j aW4+pcYe3UuhØLQN1xACIAc2S3+k2N ikø 
SSH 
a660mRU1sk54qca//mmJ/dBqaVdnj 7aERaZXOuZq/ 
xrpnN0DYR6N05RFc9WtBZQvttqyCLFsyPL3KudOpC 
f FfDEn+S+nQyNXW/FGyn1gPPSj dlNk0FfkØwKwH83x 
XXS ILPBTpc2/6yH ipdkXAULFFj u9MMViEXBsj 1 PdTcj soTbN/YF3BWXVEBs75zM84QLj foD 
fan321@gmail. com 
ple$ cd 
s2YRbAi 
app e 
JA, 613.01 
README.md 
NeteaseNews 
e 2015 GitHub, Inc, Terms Privacy Security Contact 
know 
app —3:ftE4 apple$ Is 
ap a le$ git clone git@github. com: liufan321/NeteaseNews.git 
rung In o Neteas w 
T e authenticity of host 'github.com (192.3ø.252.129)' can't be established. 
SA key fingerprint is 
re you sure you want to continue connecting (yes/no)? yes 
Permanently added 'github.com, 192.3ø.252.129' (RSA) to the list of 
Wa rning: 
n hosts. 
Status API Training 
Shop 
Blog About Help 
Label 
Button

   

  11. 到此已经把项目 克隆到本地了.   现在就可以在本地创建的文件夹中新建xcode工程了

 

  12.当项目提交到github中时会出现  

      计算机生成了可选文字:
The working copy "NeteaseNews" failed to 
commit files. 
*** Please tell me who you are. 
Run 
git config --global user.email "you@example.com " 
git config --global user.name "Your Name" 
to set your account's default identity. 
Omit --global to set the identity only in this repository. 
fatal: unable to auto-detect email address (got 
'jyq@localhost.(none)') 
OK

  13.解决办法:打开.config文件

    计算机生成了可选文字:
O iCloud Drive 
AirDrop 
Desktop 
apple 
.git 
branches 
COMMIT_EDITMSG 
config 
escrip Ion 
HEAD 
hooks 
info 
logs 
objects 
packed-refs 
refs 
day-4 
test 
HÉ51J 
NeteaseNews 
.gitignore 
LICENSE 
News 
README.md

  14,增添用户信息

      

  15.紧接着会出现下放对话框

计算机生成了可选文字:
Enter your credentials for the repository INeteaseNewsI on 
host Igithub.coml. 
If you do not have access to the repository, you may remove it in Account 
preferences. 
Authentication: 
User Name: 
Public Key: 
Private Key: 
Passphras 
SSI-I Keys 
git 
ssh-rsa AAAAB3NzaC...546017410@qq.com 
/Users/a le/.ssh/id_rsa 
Cancel 
OK

  16.一切ok

原文地址:https://www.cnblogs.com/jiayongqiang/p/4908234.html