git命令
wang 2021-07-21 git
# git命令
# 克隆
git clone https://gitee.com/syyo/syyoAdmin.git
1
# 码云图片地址
# https://gitee.com/用户名/项目名/raw/master/项目路劲/图片名称
https://gitee.com/syyo/images/raw/master/images/菜单模块_20200817095128.png
1
2
3
2
3
# 添加到本地
git add .
1
# 提交到本地
git commit -m "项目结构优化"
1
# 连接远程仓库地址
git remote add origin https://gitee.com/syyo/syyoAdmin.git
1
# 推送到远程仓库
git push -u origin master
1
# 更新
git pull --rebase origin master
1
# 清除缓存
git rm -r --cached 文件名
1
# 回退到commit的版本
git reset --hard 提交id
1
# 查看所有分支
git branch -a
1
# 查看当前
git branch
1
# 切换分支
git checkout 分支名
1
# 配置
# 配置
git config --global user.name "syyo"
git config --global user.email "78766003@qq.com"
1
2
2
# 新仓库
mkdir syyoAdmin
cd syyoAdmin
git init
touch README.md
git add .
git commit -m "first commit"
git remote add origin https://gitee.com/syyo/syyoAdmin.git
git push -u origin master
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# 已有仓库
git init
git add .
git commit -m "first commit"
git remote add origin https://gitee.com/syyo/syyoAdmin.git
git push -u origin master
1
2
3
4
5
2
3
4
5