获取ssh密钥
$ssh-keygen -t rsa -C "your_email@youremail.com"
$ssh -T git@github.com 检查绑定成功?
配置全局
git config --global user.name "your.gitname"
git config --global user.email "your.gitemail"
创建项目
git clone https://github.com/lin-tony/####.git 下载项目源码 git log 查看历史提交记录 git checkout commitId 回到某一历史版本(commitId在log中查看 git checkout master 回到最新版本 git add readme.txt 将该文件加入缓冲区(红色文件名代表此文件还未被Git所管理,绿色则ok) git add . (如果全部都要更新)加入所有修改到缓冲区(文件名变为绿色) git status 查看缓冲区状态 git commit -m "##" 提交,##是文件的描述git push origin ## push##分支
git pull 下载最新代码 git checkout -b ## 创建分支 git branch -D ## 删除分支 git checkout master 切回主分支 原文:https://www.cnblogs.com/tony-/p/9061438.html