git常用的命令
2017-04-18 14:17
148 查看
git称为分布式版本管理工具,而svn称为集中式管理工具
git add 文件名 添加到暂存区
git commit -m”注释” 添加到文件到版本库
git status 查看状态
git log 查看日志
git diff 文件名 查看文件的不同
git brance 查看分支
git reflog 查修历史记录
git reset –hard 编号 返回指定的版本
git chechout -b dev 创建dev分支
git brance -d dev 删除 dev分支
git checkout dev 切换到dev分支上
git merge name 把name分支合并到当前分支上
git remote 查看远程库的信息
git remote –v 查看远程库的详细信息
git remote add origin URL 添加到远程版本库
git push -u origin master 推送到版本库
git push origin dev把dev分支推送到服务器
git clone URL从远程版本库把文件load下来
ssh-keygen -t rsa –C “wpfsean@126.com”生成公私钥匙
git config -l查看配置信息
git config –global user.name “wpd”配置用户名
git config –global user.email “wpfsean@126.com”配置邮箱地址
git branch –decorate查看 head指针的指向
若有错误之处,请大家指出,共同学习进步。
常用以下的命令:
git init 初始化仓库git add 文件名 添加到暂存区
git commit -m”注释” 添加到文件到版本库
git status 查看状态
git log 查看日志
git diff 文件名 查看文件的不同
git brance 查看分支
git reflog 查修历史记录
git reset –hard 编号 返回指定的版本
git chechout -b dev 创建dev分支
git brance -d dev 删除 dev分支
git checkout dev 切换到dev分支上
git merge name 把name分支合并到当前分支上
git remote 查看远程库的信息
git remote –v 查看远程库的详细信息
git remote add origin URL 添加到远程版本库
git push -u origin master 推送到版本库
git push origin dev把dev分支推送到服务器
git clone URL从远程版本库把文件load下来
ssh-keygen -t rsa –C “wpfsean@126.com”生成公私钥匙
git config -l查看配置信息
git config –global user.name “wpd”配置用户名
git config –global user.email “wpfsean@126.com”配置邮箱地址
git branch –decorate查看 head指针的指向
公匙和私匙位置:C:\Users\root\.ssh
若有错误之处,请大家指出,共同学习进步。