- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
Github 是我项目的默认存储库(只是“origin”重命名为“github”)。发生了一些事情,以至于“git push”导致“非快进更新”错误,即使“git push github master”有效。 “git pull”和“git pull github master”都表示最新状态。我如何 (a) 确保 Github 上没有未 merge 的更改,以及 (b) 更正非快进错误?
$ git status
# On branch master
nothing to commit (working directory clean)
$ git pull
Already up-to-date.
$ git pull github master
From github.com:MikeBlyth/mission_net
* branch master -> FETCH_HEAD
Already up-to-date.
$ git push github master
Everything up-to-date
$ git push
To git@github.com:MikeBlyth/mission_net.git
! [rejected] add_command -> add_command (non-fast-forward)
error: failed to push some refs to 'git@github.com:MikeBlyth/mission_net.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
我的git配置文件是
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "github"]
url = git@github.com:MikeBlyth/mission_net.git
fetch = +refs/heads/*:refs/remotes/github/*
[branch "master"]
remote = github
merge = refs/heads/master
[remote "heroku"]
url = git@heroku.com:joslink.git
fetch = +refs/heads/*:refs/remotes/heroku/*
merge = refs/heads/master
[remote "heroku"]
url = git@heroku.com:joslink.git
fetch = +refs/heads/*:refs/remotes/heroku/*
最佳答案
'git push' 的语法支持显式和速记版本。显式版本 git push github master
适合你。简写版本 git push
没有。
如果你使用速记版本,你不会告诉 git 使用哪个远程分支以及应该将哪个本地分支推送到哪个远程分支。因此 git 必须猜测你的意思。
您可以使用 Remote 的设置和 push.default 配置来配置它:
push.default
Defines the action git push should take if no refspec is given on
the command line, no refspec is configured in the remote, and no
refspec is implied by any of the options given on the command line.
Possible values are:
· nothing - do not push anything.
· matching - push all matching branches. All branches having the
same name in both ends are considered to be matching. This is
the default.
· upstream - push the current branch to its upstream branch.
· tracking - deprecated synonym for upstream.
· current - push the current branch to a branch of the same
name.
查看 git branch -vv
以检查当前分支跟踪的分支。然后检查 git config --get push.default
以验证它是否按照您的预期进行。
关于即使在 'non-fast-forward updates' 之后,Git 也会给出 'git pull' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14291901/
以下操作是否完全相同: request.setAttribute(name,"visited"); requestDispatcher.forward(request,response) 和
有两个 header 用于处理请求转发。首先是 X-Forwarded-For第二个是 Forwarded . 我应该使用哪一个? X-Forwarded-For 是事实上的,而 Forwarded
看the documentation for std::forward , template constexpr T&& forward( typename std::remove_reference
给定一个手电筒的nn.Module带有预前钩,例如 import torch import torch.nn as nn class NeoEmbeddings(nn.Embedding):
为了在我的 ASP.NET 应用程序中获取客户端 IP 地址,我使用了 X-Forwarded-For,并从列表中获取第一个 IP 地址(根据我找到的信息,有一个客户端,代理1、代理2..)。但我最近
以下 header 有什么区别? X 转发主机 X 转发服务器 在 Apache 作为代理、Tomcat 作为源服务器的设置中,我在到达 Tomcat 的 HTTP 请求中看到它们。值是(这是我自己的
假设我想要一个通用的高阶函数。最常见的方法是: 一个。通用 lambda auto F1 = [](auto f) { /*...*/ } B.函数模板 template auto F2(F&& f)
为了在我的 ASP.NET 应用程序中获取客户端 IP 地址,我使用了 X-Forwarded-For,并从列表中获取第一个 IP 地址(根据我找到的信息,有一个客户端,代理 1、代理 2 ..)。但
我有一个场景,我想使用 Context.Forward 将上下文转发到另一个对话框,它工作得很好。现在,如果我更新代码以获取对话框堆栈并使用 DialogStack.Forward,则会导致 Stac
我遇到了 std::forward 的两种变体与可变参数模板参数一起使用。 template void foo(Args&&... arga) { bar(std::forward(args
考虑 std::apply 的可能实现: namespace detail { template constexpr decltype(auto) apply_impl(F &&f, Tuple &
我在 Foo Controller 中有一个需要参数的 Action 方法: public function fooAction($one, $two) { $a = one; $b
这些功能是否等效? template void foo(T && t) { bar(std::forward(t)); } template void foo2(T && t) {
在建立从 Fedora 23 到 Centos 7 的 ssh 连接时,我遇到了一个不幸的问题。命令 ssh -X user@centos7和 ssh -Y user@centos7都打印 警告:没有
作为从 Struts 1.x 迁移到 Spring Boot 的一部分,我一直在努力正确转发应有的信息。 最初的 Struts 版本依赖于 web.xml,尽管我想将该项目转换为更新的、完全基于 Ja
我使用了net = cv2.dnn.readNetFromCaffe(protoFile, WeightsFile),然后循环播放实时视频帧以使用net.forward()") bre
我注册了域名 www.a.com 然后我将屏蔽(使用 GoDaddy)流量从 www.a.com 转发到 www.really.long.url.com,因此用户在访问我的网站时只会在地址栏中看到 w
我有一个域,例如 domain.org以及地址为 http://server/node/myname 的服务器上的托管空间. 我如何映射 domain.org至 http://server/node/
我有jsp,具体取决于我正在转发到另一个页面的某些条件。 我有/myjsp/first.jsp 其代码如下, 在这段代码中,if flow come to else 条件控
前向声明和前向引用有什么区别? 在我看来,前向声明是当你声明一个尚未实现的函数时,但这不正确吗?您是否必须查看特定情况以声明案例“前向引用”或“前向声明”? 最佳答案 一个 前向声明是在实现和使用方法
我是一名优秀的程序员,十分优秀!