git 其他

commitID

HEADcommitIDtagbranchName 等在很多地方都是等效的    

HEAD^   HEAD~   HEAD^3   HEAD~3   HEAD@{3}reflog里第4commit    commit^ commit的父commit

如果有冲突,需要解决后再addcommit,形成新的commit对象

 ++ -的含义

git config

不加参数  或加--global   或加--system   分别代表当前版本库、当前用户、当前系统的配置

git config   显示配置         git config user.name  显示具体的值

git config --list

git config -e--global  编辑配置文件

git config --unset --global user.name

git config --global user.name "ts65213" \

&& git config --global user.email "[email protected]" \

&& git config --global alias.st status   \

&& git config --global alias.ci "commit -am" \

&& git config --global alias.ps "push" \

&& git config --global alias.pl "pull" \

&& git config --global alias.co checkout \

&& git config --global alias.br branch

git config --global color.ui true   //开启颜色提示

git config --global core.autocrlf false     //不转换换行符

git config --global core.whitespace cr-at-eol //忽略^M

其他

git --version  查看git版本

git clean -fd  删除未跟踪的文件   -nd 查看将要删除的文件

.gitignore里忽略的文件,只对未跟踪的文件有效,已跟踪的文件的修改会被提交

ssh-keygen -t rsa -b 4096 -C "[email protected]"

HTTP方式免密

执行 git clone http://abc.com/ddd.git 之后

修改 .git/configurl = http://账号:密码@git.ops.test.com.cn/root/puppet.git

克隆仓库的时候 git clone http://账号:密码@git.ops.test.com.cn/root/puppet.git ,这样下次提交时也不需要输入密码。

猜你喜欢

转载自www.cnblogs.com/ts65214/p/12967305.html