[windows用户请戳](http://msysgit.github.com/](http://msysgit.github.com/)
[mac用户请请戳](http://code.google.com/p/tortoisegit/(http://code.google.com/p/tortoisegit/)
一路下一步下一步既可
执行如下代码 生成.git文件夹,表示本地git创建成功
git config --global user.name "littonishir" git config --global user.email "littonishir@gmail.com" git init“你的邮箱” 然后一路回车,直到出现randomart image 既可
ssh-keygen -t rsa -C "littonishir@gmail.com"cat 一下 把key 复制下来
cat /c/Users/yang/.ssh/id_rsa.pub打开github,选择Account Settings
左边选择SSH and GPG Keys,点击New SSH key title不重要 将你复制的key粘贴进来 Add SSH Key既可
验证是否成功
ssh -T git@github.com回车就会看到:You’ve successfully authenticated, but GitHub does not provide shell access .这就表示已成功连上github.
1.点击+号->new repository 填写Repository的名字 填写Repository的描述 (Initialize this repository with a README)可选
2.创建完成后点击clone or download 复制Repository的地址
1.git 的基础配置,作用是告诉 git 你是谁
git config --global user.name "littonishir" git config --global user.email "littonishir@gmail.com"2.在你的需要初始化版本库的文件夹中执行
git init git remote add origin git@github.com:littonishir/hello.git3.如果你想克隆一个项目,只需要执行(不是必须)
git clone git@github.com:littonishir/hello.git1.进入你已经初始化好的或者克隆项目的目录,然后执行
git pull origin master git add .2.若出现该warning: LF will be replaced by CRLF in xxx文件(解决办法如下代码)
git config --global core.autocrlf false //禁用自动转换3.提交信息
git commit -m "Initial commit"4.正式上传
git push origin master至此代码上传完成
添加
git add 文件名提交
git commit -m "update Readme.md"推送
git push origin master将本地更新的代码push到远程(如果普通的git push origin master提交不上,又不是协同开发,可以使用这个)
git push -u origin master -f