git windows环境配置

登录http://windows.github.com/,点击“download Github for Windows”,下载安装包GitHubSetup.exe,此工具为图形化界面。

安装msysgit方法:
1.从google code下载windows的git安装包msysgit,下载Git-1.7.4-preview20110204.exe
2.选择TrueType Front---->Don't create a Start Menu folder---->Use Git Bash only---->Use OpenSSH---->Checkout Windows-style,commit Unix-style line endings
3.创建本地Git文件夹,选择Git文件夹,右键选择Git Bash Here,弹出shell命令界面
4.生成自己的public key,命令行执行:ssh-keygen -C "email地址" -t rsa,后续全部默认,回车
5.设置github帐号的ssh key:登录github,进入setting,选择ssh key,输入title和key,add key
6.设置email和nickname:
git config -global user.email email地址
git config -global user.name 昵称
7.clone一个git项目到本地:右键点击一个Git目录,选择Git GUI,选择“克隆已有版本库”,在Source Location中输入github上项目地址,在Target Directory中输入目标路径

git开发常用命令:
git bash中的linux命令没什么区别
git add $filename: 将新建的文件添加到暂存区
git commit -m "your comments": 提交你的更改
git remote and origin [email protected]:username/appname.git: 添加远程服务器仓库
git push origin master: 提交你的更改到服务器

猜你喜欢

转载自tbmxp.iteye.com/blog/1954870