-
1、到需要上传的版本管理的文件夹,右键选择 git bash here
-
2、初始化本地git项目
git init
git add .
git commit -m "初始化项目"
git config --global user.email "github登陆的邮箱"
git config --global user.name “github用户名”
-
3、github上创建仓库
-
4、关联本地和远程仓库,并提交代码
git remote add origin 仓库http地址
git push -u origin master
-
5、某个知识点的项目文件上传之后,使用tag
git add .
git commit -m "知识点1"
git push -u origin master
git tag 01_知识点1
git tag
查看已经创建的tag
git push --tags
git管理tags -
6、需要在原始项目上修改知识点2,先回退版本,再利用tag
git log
查看提交记录及commit编号
git reset --hard commit编号
回退到指定版本
如果修改提交知识点2之后,需要重新看知识点1
git checkout 01_知识点1
方便程序学习的git tag版本管理小技巧
最新推荐文章于 2024-05-26 20:25:34 发布