- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我有一个 git 存储库,使用了几年没有问题。我使用 SmartGit 来方便地做大多数事情。
我最近注意到,在从 dev 分支从 SmartGit 进行推送时,它显示的确认对话框显示“将当前分支‘dev’推送到‘master’”,而不是像以前那样从 dev 到 dev。
我切换到 git cmd 行来比较行为,发现它也想推送到 master:
$ git push --dry-run
To https://github.com/some_repo.git
c00bb9e..6a8ade4 HEAD -> master
使用 refspec 推送按预期工作,但我似乎无法找到一种方法来告诉 SmartGit 使用该 refspec 或者它如何决定它将推送 dev -> master。
$ git push origin dev --dry-run
To https://github.com/some_repo.git
428dd9b..6a8ade4 dev -> dev
Git 状态和引用按预期显示:
$git status
On branch dev
Your branch is ahead of 'origin/dev' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
$ git symbolic-ref HEAD
refs/heads/dev
我的配置 push.default 设置为“简单”,这应该意味着当前将推送到远程上的相同名称,如果不匹配则提示。
git config push.default
simple
我还重置了“upstream-to”,但仍然是一个普通的 git push 最终想要执行 HEAD -> master。
$git branch --set-upstream-to origin/dev
Branch dev set up to track remote branch dev from origin by rebasing.
我不知道这可能是什么原因,以及如何回到一个简单的 git push 去匹配 current 的分支和/或如何让 SmartGit 停止提供推送 current -> master。
Git 版本:2.5.0
SmartGit 版本:8.0.3 #8135
最佳答案
来自 git-push(1)
:
When the command line does not specify what to push with
<refspec>...
arguments or--all
,--mirror
,--tags
options, the command finds the default<refspec>
by consultingremote.*.push
configuration, and if it is not found, honorspush.default
configuration to decide what to push (Seegit-config
(1) for the meaning ofpush.default
).
听起来你有 remote.dev.push
设置为 HEAD
.
关于尽管设置了 upstream-to 和 push.default,Git 仍推送 HEAD -> master,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41513139/
在git中,以下有什么区别? 头 头^ HEAD~1 HEAD~2 它们与 master 有什么关系?那么有没有MASTER^, MASTER~1?? 最佳答案 HEAD 是当前分支上最新提交的同义词
我想实现一个 LinkedListremove 方法,该方法可以删除任何特定位置的项目,但在本例中,我最感兴趣的是删除列表开头(第 0 个位置)的项目。 我的代码适用于 n 大于零的值,因此我为 n=
的顺序有什么关系吗?或 或 标签位于 中? (愚蠢的问题,但其中一件事我直到现在才考虑过。) 最佳答案 优化 据 Yahoo! 的人说你应该put CSS at the top和 scripts
HEAD 是指向当前分支的指针。我见过 HEAD 祖先的各种符号,包括 HEAD~2 HEAD^2 HEAD@{2} 头~~ 头^^ 以上每一项到底是什么意思?这方面的文件在哪里? 最佳答案 来自文档
我对 git 很陌生,任何人都可以帮助我。 我实际上被困在什么是“git diff HEAD”。 “git diff HEAD”和“git diff HEAD HEAD~1”有什么区别 最佳答案 gi
我似乎不知道如何获得 git_reference *到特定 Remote 的 HEAD。 我有: git_repository * repo = NULL; git_reference * ref
关于 firefox浏览器控制台,我可以访问 容器如下所示。 > window [object Window] > documentObject = window["document"
我使用 asp.net 4 和 c#。 我在 Web From 页面中有一个 Web 用户控件。当我包含 Web 用户控件时,我还想以编程方式在最终生成的页面的标记中包含一些脚本。 知道怎么做吗?也许
这可能是一个非常愚蠢的问题,但是加载文件中标签之间的数据并通过 PHP include() 加载它是愚蠢的吗?这样就可以更轻松地进行编辑。谢谢。 最佳答案 不,这不会是愚蠢的。代码重复越少越好。 关于
我编写了以下 facelet index.xhtml: 当我从浏览器获取
我有一个不断递增的“指针”,我需要最终返回指针的“头”。我进退两难,要么使用“pointer[0]”,要么使用另一个名为“head”的变量并初始化它并在最后返回。我觉得前者使代码看起来很脏,后来占用的
git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME_PRODUCTION.git HEAD 和 git pu
当我像这样将 Git 子模块添加到 Git 存储库时, git submodule add ssh://server/proj1/ proj1 git submodule init git submo
我的本地存储库中有一个我不打算推送的提交(A)。现在,HEAD 在 A 处。假设我想在提交 (A) 之上创建另一个提交 (B) NOT,但在前一个提交之上而不是提交 (A)。 如何在不丢失最新
多次调用 head.load 是否同步? 我的意思是,如果我们有这样的代码: head.load('scr1.js',...,'scr8.js'); head.load('scr11.js',...,
执行以下查询时出现以下错误: #1054 - Unknown column 'headings.heading' in 'field list' 标题表中肯定有一个名为“标题”的列。当我测试它时,问题
我试图显示上次提交与之前提交之间的差异: git diff HEAD^ HEAD 但是什么都不显示。事实上,我知道这两个提交之间存在差异。 我做错了什么,我应该如何改正? P.S.:我觉得这个问题以
这就是场景。我有一个运行一些测试的脚本。我需要制作另一个接受 git 提交名称作为参数的脚本,然后执行以下操作: 保存当前提交状态 - 分支名称或未命名提交。 在指定提交时切换到分离的 HEAD 针对
我发现自己经常输入这个,比如当我做了一些改变,提交它,然后要么需要查找我在那里做的事情来弄清楚下一步该做什么,要么确保我没有添加任何意外的东西在将其推送到远程之前提交。 无可否认,diff HEAD^
我是否理解正确,Git head(小写)和 Git HEAD(大写)的区别在于前者是结束提交,后者只是当前提交(无论是最终提交还是非最终提交被选为 HEAD 提交)? 编辑:“结束提交”是指“给定分支
我是一名优秀的程序员,十分优秀!