git init

1.git全局参数设置

1.1查看版本
$ git --version

1.2.配置用户名和邮箱地址,在版本库提交时用到
$ git config --global user.name "yinnana"
$ git config --global user.email "nanayin@creditease.cn"

1.3.设置git别名,以便可以使用更为简洁的子命令
$ git config --global alias.st status

1.4.在git命令输出中开启颜色显示
$ git config --global color.ui true

1.5.禁止换行符的转换

$ git config --global core.autocrlf false

2.初始化版本库

1.初始化
$ git init gitdemo

2.查看版本仓库
$ cd gitdemo

$ ls -aF
./  ../  .git/

.git 目录就是git版本库(repository)
所在的目录(F:\gitdemo)被称为 工作区,当前工作区除了包含一个隐藏的.git版本库目录外空无一物。

3.创建一个文件aa.txt,内容为"hello"
$ echo "hello" >aa.txt

4.将文件添加到版本库:
$ git add aa.txt

nanayin@201605050385- MINGW64 /f/gitdemo (master)
$ git commit -m 'initialized'
[master (root-commit) df69eb9] initialized
warning: LF will be replaced by CRLF in welcome.txt.
The file will have its original line endings in your working directory.
 1 file changed, 1 insertion(+)
 create mode 100644 aa.txt

CRLF -- Carriage-Return Line-Feed 回车(CR, ASCII 13, \r)  换行(LF, ASCII 10, \n)

windows中的换行符为 CRLF, 而在linux下的换行符为:LF

使用git来生成一个文件后,文件中的换行符为LF, 当执行git add .时,系统提示:LF 将被转换成 CRLF

解决办法,上述1.5 禁止换行符的转换



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值