远程仓库代码下载到本地仓库
git clone project_url切换分支
git checkout branch_name新建并切换至本地分支
git checkout -b new_branch_name分支同步master代码
git rebase origin/master
git push -f origin branch_name显示工作目录文件状态
git status 提交本地修改文件到git索引库
git add index.html把所有修改文件提交到git索引库
git add --all提交索引拉回暂存区
git reset HEAD index.html恢复文件为修改前状态
git checkout index.html查看修改前后的内容
git diff index.html把修改索引添加到本地仓库
git commit -m "commit comment"提交本地代码至远程分支
git push origin new_branch_name将远程仓库代码下载至本地
git fetch branch_name本地分支和远程分支代码合并
git merge origin/feature_branch_name不同分支代码合并
先切换至 feature_branch_a
git checkout feature_branch_a
再将feature_branch_b合并到feature_branch_a分支
git merge feature_branch_b远程代码下载合并到当前工作的分支
git pull查看代码提交记录
git log