git 上传本地代码
新增本地代码到远程库
http://blog.csdn.net/hanhailong726188/article/details/46738929
github配置教程
http://www.runoob.com/w3cnote/git-guide.html
使用Git命令三实现代码上传与同步
http://www.jianshu.com/p/ac8923bce53e
首次建立git
http://www.jianshu.com/p/60c0741fcacc
拉取远程的Repo到本地(如果已经在本地,可以略过)
$ git clone xxxxxx
在本地仓库删除文件
$ git rm 我的文件
在本地仓库删除文件夹
$ git rm -r 我的文件夹/
此处-r表示递归所有子目录,如果你要删除的,是空的文件夹,此处可以不用带上-r。
提交代码
建立本地git库
$ git init
加入git版本控制
$ git add .(file)
提交到本地库
$ git commit -m"我的修改"
首次推送与GitHub库建立连接
$ git remote add origin https:github.com/xxx/xxxx.git
推送到远程仓库(比如GitHub)
$ git push origin master
后续推送
$ git push
首次推送
$ git push origin +master
新建库完整步骤:
全局配置:
$ git config --global user.name author #将用户名设为author
$ git config --global user.email author@corpmail.com #将用户邮箱设为author@corpmail.com
项目可配置不同name,email(不要--global 为项目配置)
查看:
$ cat ~/.gitconfig | head -3
建立ssh公钥:
ssh-keygen -t rsa -C 407934595@qq.com
复制公钥:vim ~/.ssh/id_rsa.pub
到github中添加公钥
设置默认分支
git config -e
$ git init
$ git add *
$ git commit -m "123"
$ git remote add origin git@github.com:fosonRong/myfirstdll.git
$ git push origin +master
update:
$ git pull
$ git pull git@github.com:fosonRong/myfirstdll.git

浙公网安备 33010602011771号