码迷,mamicode.com
首页 > Windows程序 > 详细

windows下使用github

时间:2016-04-11 22:13:38      阅读:223      评论:0      收藏:0      [点我收藏+]

标签:

 

1.安装

下载软件: https://git-for-windows.github.io/

 

2.设置

打开Git Bash,输入如下内容,并将名字和email替换成你的

$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"

技术分享

 

设置ssh,以后每次push就不需要输入用户名和密码了

$ ssh-keygen -t rsa -C "your_email@youremail.com" 

然后一路Enter下一步

打开新生成的.ssh文件夹中的 idrsa.pub 文件,复制其中的内容

在github中打开setting->ssh,或者直接打开链接-〉 https://github.com/settings/keys

将刚复制的内容粘贴进取

 

技术分享

 

3.使用

开始一个项目前,先在github上新建一个repo,然后将该repo的ssh连接复制回来

 

技术分享

 

打开bash,cd到适合的位置,将新建的repo clone到本地,将clone后的链接替换为你repo的链接

$ git clone git@github.com:hardihuang/happyhome_wiki.git

然后在这个文件夹里创建项目

需要同步文件时用如下命令

git add -A
git commit -m some notes
git push

因为之前设置过ssh了,所以这时git push 不会再要求输入用户名和密码了

 

 


 

参考资料:

《史上最浅显易懂的Git教程》

 

windows下使用github

标签:

原文地址:http://www.cnblogs.com/hardi/p/5380263.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!