初始化我的项目
- git config -l 列出所有git配置
- git config --system --list 列出 /etc/gitconfig 文件中的所有配置(git 命令实质就是一段脚本在读写机器上的某个文件)
- git init 初始化一个git仓库 (执行后,会在以后文件夹下创立.git文件夹)
文件操作
- git文件的四种状态
- git status [filename] 命令能够查看文件的状态
- git add ./[filename] 命令将文件的状态从 untracked -> staged
- git commit -m 将staged状态的文件同步到本地仓库
- git push
分支操作
- git branch 列出本地所有分支
- git branch -r 列出remote所有分支
- git branch [new-branch-name] 创立新的分支,但依然停留在以后分支
- git branch -b [new-branch-name] 创立新分支,并switch到新分支上
- git meger [branch-name] 将制订的分支,合并到以后分支
- git branch -d [branch-name] 删除本地分支
- git push origin --delete [branch-name] 删除近程分支
- git branch -dr [origin/branch-name] 删除近程分支
常用命令:https://gitee.com/all-about-git
学习网站:https://oschina.gitee.io/lear...