【问题标题】:git push non for all the commitsgit push non 用于所有提交
【发布时间】:2014-12-30 10:24:56
【问题描述】:

在我的项目中使用 git push 时遇到问题。我有 7 个提交要推送,但它们对于我的互联网连接来说太大了,我无法完成命令。

所以我想推送最旧的提交,而不是第二个,依此类推。

查看提交名称并一次推送一个的命令是什么?

【问题讨论】:

标签: git push commit


【解决方案1】:

假设您有这样的历史记录:

A -- B -- C -- D -- E -- F -- G -- H
|                                  |
origin/master                      master

您要做的是先只推送B,然后只推送C,以此类推。

为此,您可以多次使用该命令

git push <remote name> <local commit to push>:<remote branch>

ie:使用连续的命令

git push origin B:master
git push origin C:master
...
git push origin H:master

其中B 应替换为提交B 的sha1(或通过任何其他方式指向此提交。例如master~6

【讨论】:

    猜你喜欢
    • 2015-02-18
    • 1970-01-01
    • 2013-10-05
    • 2018-07-02
    • 2017-10-04
    • 2011-06-02
    • 2016-01-17
    • 2016-01-04
    相关资源
    最近更新 更多