git使用笔记

    • 暂存工作区 git stash
    • 下载暂存工作区 git stash apply
    • 切换分支 git checkout master
    • 查看本地分支 git branch -a
    • 删除本地分支 git branch -d dev
    • 切换本地分支并下载远程分支源码 git checkout -b dev origin/dev
    • 提交代码 1)git add . 2)git commit -m "msg"3) git pull origin dev
    • git add . 时提示如下 
      warning: LF will be replaced by CRLF in app/Models/Entity/WitkeyMsg.php. 
      The file will have its original line endings in your working directory. 
      对应的解决方案是: 
      Git 可以在你提交时自动地把回车(CR)和换行(LF)转换成换行(LF),而在检出代码时把换行(LF)转换成回车(CR)和换行(LF)。 你可以用git config --global core.autocrlf true 来打开此项功能。 如果是在 Windows 系统上,把它设置成 true,这样在检出代码时,换行会被转换成回车和换行:

      git config --global core.autocrlf true

    • 全局设置用户名密码

      git config --global user.email "dongge@test.com" 
      git config --global user.name "dongge" 
      git config --global user.password "*" 
      git config --global credential.helper store 
      重启机器后生效

posted @ 2018-11-19 14:51  _DongGe  阅读(86)  评论(0编辑  收藏  举报