美文网首页
Git 相关

Git 相关

作者: 这个懒虫不太懒 | 来源:发表于2018-12-10 18:55 被阅读0次
    git config --global user.name 范圣帅
    git config --global user.email fanshengshuai@gmail.com
    git config --global core.editor vim
    git config --global merge.tool vimdiff
    git config --global color.ui true
    git config --system alias.st status     #git st
    git config --system alias.ci commit   #git commit
    git config --system alias.co checkout  #git co
    git config --system alias.br branch  #git branch
    git config core.filemode false # 忽略权限变化
    git config --global core.autocrlf false # 换行符
    git config --global core.safecrlf true # 检查换行符
    git config receive.denycurrentbranch ignore # 设置可以 push
    git config branch.master.remote origin # 默认 pull
    git config branch.master.merge refs/heads/master
    # 配置一个git lg 用来显示分支图
    git config --global alias.lg "log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative" 
    git config --global push.default simple 
    git config --list
    # vs中每次更新代码都会要输入账号密码,配置GIT记住密码账号。
    git config --global credential.helper store
    

    回滚到指定的版本

    git reset --hard e377f60e28c8b84158
    git checkout .
    git clean -df
    git push -f origin master
    

    一、AutoCRLF

    提交时转换为LF,检出时转换为CRLF

    git config --global core.autocrlf true

    提交时转换为LF,检出时不转换

    git config --global core.autocrlf input

    提交检出均不转换

    git config --global core.autocrlf false

    二、SafeCRLF

    拒绝提交包含混合换行符的文件

    git config --global core.safecrlf true

    允许提交包含混合换行符的文件

    git config --global core.safecrlf false

    提交包含混合换行符的文件时给出警告

    git config --global core.safecrlf warn

    相关文章

      网友评论

          本文标题:Git 相关

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