gpt4 book ai didi

git - 为什么我不能将更改推送到这个最新的 Git 子树?

转载 作者:行者123 更新时间:2023-12-03 15:16:52 28 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





Why can't I push this up-to-date Git subtree?

(12 个回答)


2年前关闭。




我在子目录“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/*
$

但是,我无法将对子树模块的更改推送到 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.
$

即使子树模块似乎是最新的:
$ 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.
$

我的 git(1) 版本:
$ git --version
git version 1.8.3.1

我是一个子树新手。请帮忙。

最佳答案

Git subtree - subtree up-to-date but can't push 很可能已经给出了答案。

I found the answer on this blog comment https://coderwall.com/p/ssxp5q

If you come across the Updates were rejected because the tip of your current branch is behind. Merge the remote changes (e.g. 'git pull') problem when you're pushing (due to whatever reason, esp screwing about with git history) then you'll need to nest git commands so that you can force a push to heroku. e.g, given the above example:



git push heroku `git subtree split --prefix pythonapp master`:master --force

关于git - 为什么我不能将更改推送到这个最新的 Git 子树?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59536502/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com