git

一.git结构  

工作区--暂存区--本地区

二.命令

初始化 git init    生成.git文件  配置config

 查看状态

git status

设置签名 

git  config user.name xxx

git  config user.email  xxx@xx.com

全局

git  config --global  user.name xxx

git  config --global  user.email  xxx@xx.com

关联远程仓库 

git remote add origin 你的远程库地址(github)

添加暂存

git add 文件名    git add -A 提交所有文件夹

提交本地库

git commit -m 'first commit' 文件名

查看历史记录一行

git log --oneline

前进后退版本

git reset --hard 哈希号

推送

git push origin xxx

克隆

git clone   xxxx.git

查看分支

git branch -v

创建分支

git branch xxxx

选择分支

git checkout xxxx

合并分支

git merge xxx

posted @ 2020-03-16 14:41  ꧁༺红尘^_^有梦༻꧂  阅读(87)  评论(0)    收藏  举报