Git
1. 基本设置
1.1 配置用户信息
git config --global user.name "hanwu"
git config --global user.email "ycyang2051@outlook.com"
1.2 查看配置信息
git config --global user.name
git config --global user.email
1.3 为常用指令配置别名
1.3.1 打开用户目录,创建.bashrc
文件
touch ~/.bashrc
1.3.2 在 .bashrc
文件中输入如下内容:
#用于输出git提交日志
alias git-log='git log --pretty=oneline --all --graph --abbrev-commit' #用于输出当前目录所有文件及基本信息
alias ll='ls -al'
- 3.3 打开gitBash,执行 source ~/.bashrc
1.4 获取本地仓库
git init
1.5 查看修改的状态
git status