git-push
本文最后更新于 2024-04-29,文章好久没更新了。
push推送仓库
参考资料
操作演示
命令格式
部分命令参数可以省略
$git <远端名称> <本地分支>:<远程分支>
# 完整的命令格式
git push [--all | --branches | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
[--repo=<仓库>] [-f | --force] [-d | --delete] [--prune] [-v | --verbose]
[-u | --set-upstream] [-o <字符串> | --push-option=<字符串>]
[--[no-]signed|--signed=(true|false|if-asked)]
[--force-with-lease[=<引用名>[:<expect>]] [--force-if-includes]]
[--no-verify] [<仓库> [<引用规范>…]]
推送本分支到默认仓库
$git push origin main:main #推送main分支到远端origin 的main分支
$git push #可简写为
$git push -f #-f 可选参数强制推送,会覆盖远端仓库的分支
其他示例
$ git push origin develop:master -f #把本地的develop分支强制 (-f)推送到远端master。
- 感谢你赐予我前进的力量
赞赏者名单
因为你们的支持让我意识到写文章的价值🙏
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 蒙蒙plus
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果