git 与 github

 1、链接github

 

1,下载git安装,成功鼠标右键既有

 

2,打开任意文件夹(目标文件夹)点击git bash here

3,输入

4,

ssh-keygen -t rsa -C "xxx@qq.com" //注意啊孩子,双引号里面是你的邮箱。填你常用的就行。还有enter代表执行。

一路enter就好。然后你会在C:\Users\Administrator\.ssh目录下面看到三个东西,其中一个是.pub格式的,用记事本打开它,复制。然后来到你的github,在setting里面找到ssh keys把你刚才复制的钥匙给粘贴了,title随便写一个。

2、向github拉

1,

git clone git@xxx.xxx.xx.xxx:android/xxx.git或者
git clone https://github.com/xxx/xx.git

 

 

 

3、往github提交

 1,

git init(初始化仓库,文件夹中已有git不用这步)

2,

git add .(把所有内容添加到索引库中)或者
git add test.html(只提交当前目录的test.html文件到本地git仓库)

3,

git commit -m "wrote a readme file" (提交索引库中的内容;-m是参数,表示注释内容,主要用来记录此次操作)

4,

git remote add origin git@github.com:sxxx/xxx.git(将本地仓库与github上的仓库关联起来,已连接可跳过) 

5,

 git pull origin master(更新代码)

6,

git push origin master(提交代码)

7,大功告成

posted on 2018-03-23 10:17  子诚  阅读(195)  评论(0编辑  收藏  举报

导航