git - 如何推送到 Gitlab 上的远程 git 分支?

标签 git gitlab git-push

我在 GiLab 上有这个 repo:

https://gitlab.com/testrepo/api.git

这个 repo 上有一个名为 testing 的分支。我怎样才能推送到这个 repo 的 testing 分支?

如果我这样做:

git push origin master

它会将我的 master 推向可能是 repo 的 master。

最佳答案

你可以使用命令:

git push origin <your_local_branch>:<remote_branch>

推送到 git 中的任何分支。在您的示例中,这相当于运行:

git push origin master:testing

关于git - 如何推送到 Gitlab 上的远程 git 分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49540633/

相关文章:

git - 如何使用 MSBuild 发出 git 分支的 SHA1

gitlab - Gitlab 可以自动删除过时的分支吗?

子项目上的gitlab管道

Git 推送错误 : Unable to unlink old (Permission denied)

git - 如何从错误的 git push -f origin master 中恢复?

javascript - 我可以使用 NodeGit 从特定提交中获取加法和减法吗?

iphone - 如何在 Xcode 中配置 Git 以使用 BitBucket

git - 将 Subversion 存储库导入 Git

通过 nginx 代理的 Docker 环境导致 502 Bad Gateway

git - 如何在 TortoiseGit 中设置默认远程引用?