- 首先,需要在本地将代码提交到 Git 仓库中,并打上要发布的版本号的 tag:
git add .
git commit -m "Commit message"
git tag v1.0.0
- 然后,将本地的 tag 推送到远程 Git 仓库:
git push origin v1.0.0
- 如果还没有在远程 Git 仓库中创建该 tag,则需要使用下面的命令创建并推送 tag:
git tag -a v1.0.0 -m "Release version 1.0.0"
git push origin v1.0.0
- 最后,将最新的代码推送到远程 Git 仓库中:
git push origin master
这样就可以将指定版本的代码推送到远程 Git 仓库中了。