- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
一段时间以来,我一直成功地使用 git-svn 连接到我的 svn 主干。我最初通过这样做设置我的 repo :
git svn clone -s http://domain.com/svn/name-of-repo
我已经使用这个设置很长一段时间(可能接近一年)并且没有遇到问题,很可能是因为我所做的一切都在本地 git 分支上,我最终 merge 回我的 master 分支,并提交回 svn 主干。
最近,我需要开始对同一 svn 存储库中的另一个分支提交一些更改,http://domain.com/svn/name-of-repo/branches/demo .
通过编辑我的 .git/config 文件并添加这些行,我能够从该分支获取一次:
[svn-remote "svndemo"]
url = http://domain.com/svn/name-of-repo/branches/demo
commiturl = http://domain.com/svn/name-of-repo/branches/demo
fetch = :refs/remotes/git-svn-demo
然后我运行以下命令来获取演示分支,从修订版 4034 开始:
git svn fetch svndemo -r 4034
所以现在我有一个新的远程分支,叫做 remotes/git-svn-demo。我从中创建了一个功能分支:
git checkout -b svndemo-local remotes/git-svn-demo
这捕获了我需要的东西,所以我做了我必须做的更改,提交到我的本地分支,然后尝试运行“git svn fetch && git svn rebase”。两者都返回错误:
Unable to determine upstream SVN information from working tree history
这就是我被困的地方。我环顾了 SO 和其他网站 (Google),但除了“git-svn 再次克隆 repo,然后重新开始”之外没有找到解决方案,这并不理想。
我查看了我的 .git/svn/refs/remotes/git-svn-demo/unhandled.log 并将其与我的 .git/svn/refs/remotes/trunk/unhandled.log 进行了比较,但没有任何内容他们有很大的不同。
我还查看了从这个远程分支的初始提取中下来的提交消息,其中包含 git-svn-id 信息。
blah blah blah, this is the commit message, blah blah blah
git-svn-id: http://domain.com/svn/name-of-repo/branches/demo@4034 e6edf6fb-f266-4316-afb4-e53d95876a76
我很想听到关于这个的新想法。
最佳答案
要访问 svn 分支,您不需要添加新的 svn 远程。当您使用 -s(标准)选项设置 git svn clone 时,git 还会跟踪在 branches 下定义的所有分支。
您应该能够使用 git branch -r
查看那些分支(在本例中为分支演示)。
如果您 checkout 它,您可以在其中工作并提交 svn dcommit。
我不确定更改 svn-remote 是否弄乱了你的存储库,但我在你的位置我会假设它已经弄乱了并且会用你原来的克隆命令重新开始。
关于Git:无法从 HEAD 历史记录中确定上游 SVN 信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6753092/
在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 提交)? 编辑:“结束提交”是指“给定分支
我是一名优秀的程序员,十分优秀!