github本地软件下载:http://pan.baidu.com/s/1eSoZY4i
注册官网:https://github.com/
github代码上传:
1.本地创建配置配置ssh
ssh-keygen -t rsa -C "your_emali@youremail.com"
命令完成后会在 C:/Users/administator/.ssh/ 生成一个id_rsa.pub 文件 也就是ssh值
2.github官网配置
key的值为本地的ssh值
验证是否配置成功:ssh -T git@github.com
3.本地代码执行
(1).右键执行 git bash here 打开命令行
(2).设置用户名和连接邮箱
git config --global user.name "your name"
git config --global user.email "your_email@"
(3).新建一个文件夹 右键执行 git bash here
git init //生成一个.git 的文件夹
(4). git add . //添加代码到本地暂存区,在bash中使用以下命令
(5).git commit -m "信息描述" //将暂存区的代码提交到HEAD,它保存你最后一次提交的结果
(6).ssh 代码提交
ssh-keygen -t rsa -C "your_email@youremail.com"
git pull origin master
git push -u origin master
文件下载:
- git clone git@github:username.com/JavaDemo.git
这里git后面的地址则为github的地址
问题:
1.fatal: Not a git repository (or any of the parent directories): .git
提示说没有.git这样一个目录,解决办法如下:
git init就可以了!