我在子目录“gempak/tables”中有一个名为“gempak-tables”的git子树模块:
$ git config -l | grep -i gempak
remote.gempak-tables.url=git@github.com:Unidata/GEMPAK-Tables.git
remote.gempak-tables.fetch=+refs/heads/*:refs/remotes/gempak-tables/*
$
Run Code Online (Sandbox Code Playgroud)
但是,我无法将子树模块的更改推送到 GitHub:
$ git subtree push --prefix=gempak/tables gempak-tables master
git push using: gempak-tables master
X11 forwarding request failed on channel 0
To git@github.com:Unidata/GEMPAK-Tables.git
! [rejected] 89d8f94d010e6677f146608674cf7408eecb4a61 -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:Unidata/GEMPAK-Tables.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
$
Run Code Online (Sandbox Code Playgroud)
即使子树模块似乎是最新的:
$ git subtree pull --prefix=gempak/tables gempak-tables master
X11 forwarding request failed on channel 0
From github.com:Unidata/GEMPAK-Tables
* branch master -> FETCH_HEAD
Already up-to-date.
$
Run Code Online (Sandbox Code Playgroud)
我的 git(1) 版本:
$ git --version
git version 1.8.3.1
Run Code Online (Sandbox Code Playgroud)
我是一个子树新手。请帮忙。
Git 子树很可能已经给出了答案- 子树是最新的但无法推送
我在此博客评论中找到了答案https://coderwall.com/p/ssxp5q
如果你在推送时遇到
Updates were rejected because the tip of your current branch is behind. Merge the remote changes (e.g. 'git pull')问题(无论出于何种原因,尤其是与 git 历史记录有关),那么你需要嵌套 git 命令,以便可以强制推送到 heroku。例如,给出上面的例子:
git push heroku `git subtree split --prefix pythonapp master`:master --force
| 归档时间: |
|
| 查看次数: |
202 次 |
| 最近记录: |