Git 相关

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 一、新建远程仓库 : 方法一:只是新建了远端仓库,本地 没有 关联 curl -u 'username'https...
    默小柒阅读 723评论 0 1
  • 1 自定义 Git - 配置 Git 配置 Git 如第一章所言,用git config配置 Git,要做的第一件...
    JasonL阅读 718评论 0 1
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,735评论 19 139
  • 小时候在农村里,每年都会有一件大事情,看庙会。 镇里乡里每年开庙会的时候,会请一台大戏来唱唱,也就那么一两次,镇上...
    香林信步阅读 864评论 0 1
  • 在小荻老师的第一期沟通训练营里,知道DISC理论。从解说看来,判断自己属于S型。果然,测评报告显示High S。 ...
    一如减法整理阅读 3,045评论 2 5

友情链接更多精彩内容