0、git结构
主要分支
在采用 Git Flow 工作流的项目中,代码的中央仓库会一直存在以下两个长期分支:
Master
Develop
其中 origin/master 分支上的最新代码永远是版本发布状态。origin/develop 分支则是最新的开发进度。
当 develop 上的代码达到一个稳定的状态,可以发布版本的时候,develop上这些修改会以某种特别方式被合并到 master 分支上,然后标记上对应的版本标签。
1、git新建repository(仓库/版本库)
2、git clone http:/...
3、git add .
git commit -m "提交信息"
git push -u origin master
参考网址:Git的使用--如何将本地项目上传到Github(https://blog.csdn.net/Lucky_LXG/article/details/77849212)
4、分支
git branch
git branch 新分支 git branch -d 新分支
git merge
参考网址:Git 分支管理(https://www.runoob.com/git/git-branch.html)
5、git 查看修改记录
在使用 Git 提交了若干更新之后,又或者克隆了某个项目,想回顾下提交历史,我们可以使用 git log 命令查看。
参考网址:Git 查看提交历史(https://www.runoob.com/git/git-commit-history.html)
6、git 标签
我们可以用 git tag -a v1.0 命令给最新一次提交打上(HEAD)"v1.0"的标签。-a 选项意为"创建一个带注解的标签"。
git tag -a <tagname> -m "runoob.com标签"
参考网址:Git 标签(https://www.runoob.com/git/git-tag.html)
网友评论