1. github创建好版本仓库
2. 本地创建好项目目录,cd到指定文件目录
cd /Users/liutiesong/Desktop/github/git_CYOCComponent
- git关联版本库基本操作
# 初始化git
git init
# 检测本地是否存在版本库
git remote
# 添加版本库
git remote add origin https://github.com/liutiesong/CYOCComponent.git
# 关联项目与版本库
git push -u origin master
- 将项目打标签提交到release
git tag -a '0.0.1' -m '初始版本'
git push --tags


提交时也可以直接提交项目到置顶版本
git tag -a '0.0.2' -m '添加test版本'
git push origin 0.0.2

5. 代码修改后提交操作
# 通过status查看代码所在区域
git status
# 通过add添加到暂存区
git add .
# 提交项目到站点
git
如果是红色,代码则在工作区

6.删除指定版本
# 查询本地版本号
git tag
#删除指定标签
git tag -d 0.0.1
# 提交并删除远程库指定版本
git push -u origin :0.0.1
- 重新设置用户名和密码
git remote set-url https://用户名@git.config.net/xxxxx/xxxxx.git
网友评论