初始化我的项目

  1. git config -l 列出所有git配置
  2. git config --system --list 列出 /etc/gitconfig 文件中的所有配置(git 命令实质就是一段脚本在读写机器上的某个文件)
  3. git init 初始化一个git仓库 (执行后,会在以后文件夹下创立.git文件夹)

文件操作

  1. git文件的四种状态

  1. git status [filename] 命令能够查看文件的状态
  2. git add ./[filename] 命令将文件的状态从 untracked -> staged
  3. git commit -m 将staged状态的文件同步到本地仓库
  4. git push

分支操作

  1. git branch 列出本地所有分支
  2. git branch -r 列出remote所有分支
  3. git branch [new-branch-name] 创立新的分支,但依然停留在以后分支
  4. git branch -b [new-branch-name] 创立新分支,并switch到新分支上
  5. git meger [branch-name] 将制订的分支,合并到以后分支
  6. git branch -d [branch-name] 删除本地分支
  7. git push origin --delete [branch-name] 删除近程分支
  8. git branch -dr [origin/branch-name] 删除近程分支

常用命令:https://gitee.com/all-about-git
学习网站:https://oschina.gitee.io/lear...