希望有人打电话帮助。首先,我对 git 很陌生,所以如果我在解释我的问题时犯了一些错误,请原谅我。
我想使用 libgit2sharp 使用库将存在的源代码拉到特定的提交。所以如果有历史
我希望能够提取 5 或该列表中的任何其他数字的源代码。任何源都不会被标记,所以我必须使用提交来进行拉取。希望有人可以提供帮助。
我看过https://github.com/libgit2/libgit2sharp/wiki/git-pull但它似乎没有让我传入 sha 或提交 ID。
编辑我的问题以明确我正在使用图书馆。
好的,最近我正在寻找一种在 PowerShell 中空合并的方法,我遇到了这篇文章:在 powershell 中空合并。
我看到@Zenexer 的评论,很感兴趣。这是语法:
Clear-Host
#expected one
"Test 1: " + ("one", "two", 1 -ne $null)[0]
#expected two
"Test 2: " + ($null, "two", 1 -ne $null)[0]
Run Code Online (Sandbox Code Playgroud)
这完美地工作。然而,我和一位同事 (Walter Puckett) 非常感兴趣,并且对语法进行了更多的挖掘,发现了一些真正的奇怪之处。
在我陷入奇怪之前,谁能指出任何解释这种语法的文档?
## THE WEIRDNESS:
# it does not matter what the number is evidently
"Test 3: " + ($null, "two", 8675309 -ne $null)[0]
# reversing the comparison test breaks the coalesce
"Test 4: " + ($null, "two", $null -ne 1)[0]
# Moving the test …Run Code Online (Sandbox Code Playgroud)