@StrGlee
2018-06-28T15:42:28.000000Z
字数 427
阅读 1279
git
git clone git@***/test.git # 克隆远程分支到本地, 默认进入master分支git checkout -b test_a # 从当前分支(master)切出新分支 test_a 用于自己开发
git add <需要提交的文件>git commit -m'本次提交的描述' # 提交到本地仓库git push # 提交到远程仓库
git fetch # 从远程仓库拉取代码git merge master # 合并远程master分支git push # 提交到远程仓库
如果有冲突 :
git diff <冲突文件名> ,然后解决冲突git add <冲突文件名>git commit -m'本次解决冲突的描述'git push # 提交到远程仓库
git checkout <文件名> # 把工作区代码还原到上次commit时候的代码
git reset <文件名> # 把暂存区文件(git add添加的文件)撤回到工作区
