
git的一些常用命令
配置
-
查看
1
2
3git config -l
git config --global -l #查看全局配置
git config --local -l #查看本地配置 -
设置
1
2
3
4git config --global user.name "John Doe" #设置用户名
git config --global user.email [email protected] #设置用户信箱
git config --global credential.helper store #设置权限保存,cache保留15分钟
git config --global core.autocrlf true # true:提交时CRLF->LF,签出时LF->CRLF;input:提交时CRLF->LF,签出时不转换;false:不转换 -
本地设置(.gitattributes)
1
2# Set the default behavior, in case people don't have core.autocrlf set.
*.sh text eol=lf
初始化
-
现有工程的初始化以及远程PUSH
-
进入项目目录,初始化本地仓库
1
git init
-
把所有文件添加到stage
1
git add .
-
提交到head
1
git commit -m "init project"
-
添加远程仓库地址
1
git remote add origin https://github.com/gikeihi/springboot.git
-
PUSH到远程仓库
1
git push -u origin master
-




近期评论