如何更新GitHub分支库?(How do I update a GitHub forked repository?)

我最近开了一个项目,并应用了几个修复。 然后,我创建了一个请求,然后被接受。

几天后,另一位贡献者又做了一次改变。 所以我的叉子不包含这个变化...我怎么能把这个改变成我的叉子?

当我进一步改变贡献时,是否需要删除并重新创建叉子? 还是有更新按钮?


I recently forked a project and applied several fixes. I then created a pull request which was then accepted.

A few days later another change was made by another contributor. So my fork doesn't contain that change.

How can I get that change into my fork? Do I need to delete and re-create my fork when I have further changes to contribute? Or is there an update button?


原文:https://stackoverflow.com/questions/7244321
2023-08-15 20:08

满意答案

这样做的方式是通过括号符号。

var test = {
    "id": "109",
    "No. of interfaces": "4"
}
alert(test["No. of interfaces"]);

欲了解更多信息,请阅读:

  • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects

The way to do this is via the bracket notation.

var test = {
    "id": "109",
    "No. of interfaces": "4"
}
alert(test["No. of interfaces"]);

For more info read out here:

相关问答

更多

是否可以使用带有多个单词的字符串作为json键?(Is it possible to use a string with multiple words as json key? [duplicate])

你这样做: var j = { "kemon acho": "I am fine" }; console.log(j["kemon acho"]); You just do: var j = { "kemon acho": "I am fine" }; console.log(j["kemon acho"]);

访问具有空格的JSON对象键(Accessing JSON object keys having spaces [duplicate])

这样做的方式是通过括号符号。 var test = { "id": "109", "No. of interfaces": "4" } alert(test["No. of interfaces"]); 欲了解更多信息,请阅读: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects The way to do this is via the bracket not...

在JavaScript中获取json对象的键[duplicate](get keys of json-object in JavaScript [duplicate])

[你只是一个对象,而不是一个“json对象”。 JSON是一种文本符号。 引用的是使用数组初始化程序和对象初始化程序 (也称为“对象文字语法”)的JavaScript代码。] 如果您可以依靠具有ECMAScript5功能,您可以使用Object.keys函数来获取对象中的键(属性名称)的数组。 请注意,较旧的浏览器将不具备此功能。 如果没有,这是您可以自己提供的一个: if (typeof Object.keys !== "function") { (function() { ...

JavaScript内部对象键,带有空格的字符串。?(JavaScript inner object key with a string having space .? [duplicate])

你可以像这样执行它 var stugrade = studentobject[0].studentinfo[0]['rama nathan']['grade']; You can execute it like this var stugrade = studentobject[0].studentinfo[0]['rama nathan']['grade'];

JSON语法是否允许对象中的重复键?(Does JSON syntax allow duplicate keys in an object?)

从标准(第ii页) : 预计其他标准将引用这一个,严格遵守JSON文本格式,同时对各种编码细节施加限制。 这些标准可能需要具体行为。 JSON本身没有指定任何行为。 在标准(第2页)中进一步说明了JSON对象的规范: 对象结构表示为一对围绕零个或多个名称/值对的卷曲括号令牌。 名字是一个字符串。 每个名称之后都有一个冒号,它将名称与值分开。 单个逗号令牌将以下名称分隔开。 它没有提及重复的密钥无效或有效,所以根据规范,我会安全地认为这意味着它们被允许。 由于第一个引用,大多数JSON库的实现不接受...

组合json对象并保留重复键(Combine json objects and keep duplicate keys)

我唯一能想到的是创建一个向对象添加前缀的函数: function addPrefix(target, prefix){ var newObj = false; if(target.constructor === Array){ newObj = []; for(var i = 0 ; i< target.length; i++){ item = target[i]; var itemObj = {}; ...

带空格的JSON数据(JSON data with spaces)

有多种方法可以实现相同的目标(一如既往)。 但是为了回答你的问题,我们采用一种方法来实现你的目标。 const body = { "Meta Data": { "1. Information": "High School", "2. Name": "St Marys" }, "Teachers' Names": { "Grade I": { "1. English": "Amanda Fernandez", "2. Soc...

使用AngularJS从JSON键和值中删除前导空格(Removing Leading Space from JSON Keys and Values Using AngularJS)

另一个答案可行,但我认为这更符合你的风格。 另请注意, 参数为v,k 。 angular.forEach(results, function (index) { angular.forEach(index, function (v, k) { delete index[k]; index[k.trim()] = v.trim(); }); }); The other answer will work but I think this is more of the...

我如何访问具有空格的对象属性[重复](how can i access the object properties that have spaces [duplicate])

您可以使用括号表示法访问 data['personal details'] 所有其他带空格的键和单个单词相同 data['personal details']['name'] 但它最好使用. 单字json键的点符号 data['personal details'].name // "Loren" data.address['temporary address'] // prints "Acn Block Ist Phase" You can access using bracket no...

将具有重复键的JSON对象转换为JSON数组(Convert JSON object with duplicate keys to JSON array)

截至今天, org.json库版本20170516提供了accumulate()方法,该方法将重复的键条目存储到JSONArray JSONObject jsonObject = new JSONObject(); jsonObject.accumulate("a", "b"); jsonObject.accumulate("c", "d"); jsonObject.accumulate("c", "e"); jsonObject.accumulate("f", "g"); System.out....

相关文章

更多

Becoming a data scientist

Data Week: Becoming a data scientist Data Pointed, ...

Stack Overflow Architecture Update - Now At 95 Million Page Views A Month

A lot has happened since my first article on theSta ...

GitHub上搭建个人网站

GitHub上搭建个人网站 分类: GitHub ...

GitHub入门教程

GitHub入门教程 分类: GitHub ...

荐 【翻译】github 搜索团队访谈

介绍 gihtub 的搜索是基于 elasticsearch 构建的,在 github.com/se ...

GitHub创建SSH Keys

GitHub创建SSH Keys 分类: GitHub ...

杨尚川 HtmlExtractor github开源项目

HtmlExtractor是一个Java实现的基于模板的网页结构化信息精准抽取组件,本身并不包含爬虫功 ...

使用GitHub-git入门教程

我们一直用GitHub作为免费的远程仓库,如果是个人的开源项目,放到GitHub上是完全没有问题的。其 ...

7月最新发布11.2.0.1.2 Patch set update

7月13日,11g release 2 的第二个补丁集更新发布了;9i的最终版本为9.2.0.8,10 ...

GitHub项目Storm-HBase介绍

最近完成了一个GitHub项目:Storm-HBase,该项目是Twitter Storm和Apach ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本