git 简易教程
git作为常用的版本控制系统,时间一久不用就忘了,故在此记录下主要的操作步骤
# 若未配置用户名和地址则需要先配置先
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git init # 将当前目录作为git仓库
git add readme.md # 添加一个文件到版本库,若commit后修改了该文件,需要再add一次再commit,修改的部分才会提交到仓库
git commit -m "first version" # 将刚才添加的文件提交到仓库,-m后为本次提交的说明,可以随便写
git tag v1.0.0 # 添加标签。此步可有可没
git remote add origin you github # 添加远程仓库
git push -u origin master # 将代码推送到远程仓库
版权声明:本文转载请注明出处!
最新评论:
发表评论
电子邮件地址不会被公开。 必填项已用*标注