美文网首页
Git简洁实例

Git简洁实例

作者: 会写bug的鸟 | 来源:发表于2018-06-10 09:12 被阅读0次

    git config --global user.name xie 

    git config --global user.email xbc923@gmai.com

    git init 初始化

    git add a.txt

    git status 

    git commit -m “测试添加”

    git rm a.tix

    git commit -m "测试删除"

    git remote add ceshi  http://   添加远程库地址http://   别名ceshi

    git remote -v查看远程库信息

    git remote remove ceshi 删除远程库别名

    git push ceshi master 把本地主分支推到远程

    git pull ceshi matser 把远程拉到本地主分支

    git log  日志

    git log .   当前目录日志

    git log a.txt  a.txt日志

    git reflog 全部日志

    git reset --hard  版本号           切换到某版本

    开发微信,期间突然开发阿里

    git branch 查看本地分支

    git branch wechat 创建本地wechat分支

    git checkout wechat 切换到本地wechat分支

    git add. 

    git commit -m 'doing"

    git checkout master

    git branch ali 

    git checkout ali

    git add.

    git commit -m "ali ok"

    git checkout master

    git merge ali

    git add.

    git commit -m "ali ok"

    git push ceshi master

    git branch -d ali 删除ali分支

    git checkout wechat

    git add.

    git commit -m "wechat ok"

    git checkout master

    git merge wechat

    git add.

    git commit -m "wechat ok"

    git push ceshi master

    git branch -d wechat 删除wechat分支

    相关文章

      网友评论

          本文标题:Git简洁实例

          本文链接:https://www.haomeiwen.com/subject/gsqfeftx.html