您的位置:首页 > 其它

git简易操作

2017-01-06 15:58 288 查看
git config --global user.name 'scales'


git config --global user.email "1477835701@qq.com"


ssh-keygen -t rsa -C "1477835701@qq.com"


cd e:
mkdir www
cd  www
mkdir myGit
cd myGit
pwd
git init

第二步:

登录github,打开
settings
中的
SSH Keys
页面,然后点击
Add SSH Key
,填上任意
title
,在
Key
文本框里黏贴
id_rsa.pub
文件的内容。

点击 Add Key,你就应该可以看到已经添加的key。

添加远程库

 

首先,登录
github
上,然后在右上角找到
create a new repo
创建一个新的仓库。

Repository name
填入
testgit
,其他保持默认设置,点击
Create repository
按钮,就成功地创建了一个新的
Git
仓库:

目前,在
GitHub
上的这个
testgit
仓库还是空的,
GitHub
告诉我们,可以从这个仓库克隆出新的仓库,也可以把一个已有的本地仓库与之关联,然后,把本地仓库的内容推送到
GitHub
仓库。

现在,我们根据GitHub的提示,在本地的testgit仓库下运行命令:

git remote add origin https://github.com/ColinScales/wechat.git[/code] 
git remote rm origin
https
不好用可以替换成
SSH
试一试

git add README.md


git commit -m 'README.md提交'


git push -u origin master


git clone https://github.com/ColinScales/wechat.git[/code] 
                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: