git学习笔记

关于git,这篇博客写的很全面
http://www.ihref.com/read-16369.htmlhtml

一、最近整理了下git一些基本命令的使用方法,方便往后参照,使用git的心得就是挺好用的git

如下为git比较经常使用的集中命令git log 查看本地的版本信息,你能够选择commit的版本号进行那个reset回到过去的某个版本svn

git reset --hard xxx git reflog 回到将来的版本信息 git reset --hard version git merge branch-name 合并分支 git checkout -b branch-name1 origin/branch-name2 检出某个远程分支到本地分支 若是本地已有分支,不用-b 必须本地存在分支,才能在master上merge别的分支 git pull 相似于svn up 拉去远程仓库代码,若是有冲突会自动合并到本地,须要你手动去解决冲突,这点和svn同样 git push origin 提交到主干
git push origin your_branch_name 把你的变动推送到一个远程仓库 git branch
-r 查看远程分支 git status 查看状态 git add 添加修改 git commit -m 提交修改 git diff git rm git clone

附图看如何回退到某个版本spa

 

相关文章
相关标签/搜索