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

windows下的Git简单入手

时间:2014-11-17 15:48:13      阅读:302      评论:0      收藏:0      [点我收藏+]

标签:style   http   使用   sp   文件   on   bs   ad   工作   

现在再搞golang,用go get github.com/xxx 命令使需要git、提交新项目到github.com也要git,老东西了,呵呵现在也要学习一下。

下载windows版的git。

 

·准备工作

设置默认用户名、邮箱:

git config --global user.name "Your Name"    

git config --global user.email "your@email.com"  

 

·添加密钥

直接在gui bash中输入:ssh-keygen -t rsa -C "your@email.com"    

提示输入,第一次输入:id_rsa,然后一路按下回车,在C:\Documents and Settings\Administrator\.ssh目录下会产生3个文件,如果没有看下当前目录有没有,然后移到那里。

使用:ssh -T git@github.com 验证是否通过。

 

·拷贝项目

git clone https://github.com/xxx 

如果新项目使用:git init,而不是git clone了。

把新增的文件放入到项目里使用:git add .     //加入所有文件

 

 

·设置远程仓库

git remote add origin https://github.com/yourname/yourprojectname.git    

//如果是线上建立的,可直接看.git是那个位置,然后把路径复制出来。git remote remove origin可以删除,git remote help获取帮助。

 

·提交

git commit -m "注释"   

 

·上传

git push -u origin master

如果提示输入用户名、密码,则表示已经可用,最后提示up-to-date

 

windows下的Git简单入手

标签:style   http   使用   sp   文件   on   bs   ad   工作   

原文地址:http://www.cnblogs.com/luckcs/p/4103640.html

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