cost 197 ms
go-git 結帳失敗,未找到參考

[英]go-git checkout failing with reference not found

我剛剛開始使用 go-git 庫,到目前為止它看起來很有前途。 但是,我正在嘗試對現有分支進行基本檢查,但失敗並顯示“未找到引用”。 我有一個簡單的存儲庫,有幾個分支,但一個是“main”,另一個是“testoffmain”。 克隆、拉取和獲取 github 回購工作沒有問題。 為分支獲取 hash ...

2023-01-19 01:36:27   1   20    go / go-git  
如何簽出特定的單個文件以使用 go-git 檢查它?

[英]How to checkout a specific single file to inspect it using go-git?

我想克隆一個特定的存儲庫,獲取所有標簽並遍歷它們。 對於每個標簽,我想檢查根目錄中的特定文件( package.json )。 如果沒有文件存在,它應該繼續,否則它應該傳遞它以便我可以檢查它。 我從以下代碼開始(我的第一個 Go 應用程序...) 有人知道如何嘗試通過給定標簽檢查循環內的文件嗎? ...

2022-08-31 20:26:48   1   17    git / go / go-git  
go-git:創建短哈希(a83ad00 而不是 a83ad004b3c5...)

[英]go-git: Create short hash (a83ad00 instead of a83ad004b3c5...)

我正在使用go-git ,我想打印短哈希。 我的意思是,例如“a83ad00”而不是“a83ad004b3c5971a194ba86b96fe313b94bbcde7”。 看了下got-git的源碼,沒找到對應的函數。 如何獲得簡短的“部分”哈希? ...

2022-07-05 06:34:12   1   18    go / go-git  
`git log -G ...` 與 golang

[英]`git log -G ...` with golang

我想用go-git寫一個類似於git log -G的腳本 此代碼打印 repos 的所有提交,但如何獲取每個提交的添加/刪除行? ...

2022-07-01 07:26:55   1   25    go / go-git  
go-git "git子模塊添加<url><submod> “</submod></url>

[英]go-git "git submodule add <url> <submod>"

TLDR 我一直在搜索 package文檔和官方示例,但無法弄清楚如何描述使用 go-git 添加子模塊。 我正在嘗試git submodule add &lt;url&gt; &lt;submod_name&gt; ,並將其配置為稀疏結帳目標我想使用 golang 的 go-git packa ...

2022-02-25 05:19:33   1   145    git / go / go-git  
如何使用 go-git 進行單元測試

[英]How to unit test with go-git

如何為使用 git-go 克隆 repo 的代碼編寫單元測試下面是我創建的 function 的示例。 我正在克隆多個存儲庫並讀取該存儲庫中的特定文件,我不確定如何對這個 function 進行單元測試。 ...

2022-01-13 06:33:45   2   27    go / go-git  
Go Git - 遞歸子模塊

[英]Go Git - Recurse Submodules

我有一個包含子模塊的項目,如此處所示。 我正在使用 go-git pkg 並嘗試使用此處顯示的選項進行克隆, 它不會遞歸地拉取子模塊。 我只看到空目錄。 我錯過了什么嗎? ...

2021-12-17 04:15:09   1   36    go / go-git  
無法使用 go-git 和訪問令牌運行 https git 克隆

[英]Unable to run https git clone using go-git and access token

使用go-git/v5並嘗試通過https進行克隆,如下所示: 其中token是ghp_XXXXXXXXX形式的字符串(我的個人 GH 訪問令牌) 並且repo等於我的私人 repo https://github.com/pkaramol/arepo 錯誤是 我還嘗試將基本身份驗證與我的用戶名和令牌 ...

2021-12-04 13:00:19   1   17    git / go / go-git  
分支之間的 go-git diff

[英]go-git diff between branches

go-git 可以獲取兩個分支之間的差異,或者,例如,當前分支和主分支? 使用 GIT 您可以獲得當前分支和主分支之間的差異: 在兩個分支之間: 我發現這個答案可以使用(*object.Commit).Patch ,但在提交之間,而不是分支之間。 ...

2021-12-02 09:30:44   1   20    go / go-git  
我如何在 go 中使用 `go-git` 模仿 `git --work-tree...`?

[英]How do I mimic `git --work-tree ...` with `go-git` in go?

我有一個裸存儲庫,我需要在其中添加和提交一組文件。 據我了解,將文件添加到索引需要一個worktree 。 在命令行上使用git ,我會將git-dir選項設置為指向裸目錄,同時將work-tree選項設置為指向要添加到索引的文件所在的工作樹。 像這樣: 值得一提的是,“.git”目錄不是也不可能 ...

2021-11-13 18:13:02   2   644    git / go / go-git  
go-git:創建本地分支的正確方法,模擬“git分支”的行為<branchname> “?</branchname>

[英]go-git: Correct way to create a local branch, emulating behavior of "git branch <branchname>"?

正如標題所示,我試圖弄清楚如何使用go-git創建一個本地分支,其結果與 Git CLI 命令git branch &lt;branchname&gt; 。 據我所知, git branch &lt;branchname&gt; (沒有明確的&lt;start-point&gt;參數)做了兩件事: ...

2021-04-18 19:16:00   2   395    git / go / go-git  
go-git 如何為第一次提交生成補丁?

[英]go-git how to generate patch for first commit?

我有以下代碼 它遍歷所有提交並使用對父級的引用為每個提交生成補丁。 但是第一次提交沒有父級,然后我無法生成補丁。 有沒有像傳遞空提交這樣的解決方法? 我正在搜索,我在歸檔go-git存儲庫上找到了 open pull request 。 ...

2021-03-31 12:39:37   1   135    git / go / go-git  
docker 多階段構建 Go 映像 - x509:由未知機構簽署的證書

[英]docker multi-stage build Go image - x509: certificate signed by unknown authority

我嘗試在私有公司網絡中使用 docker -multi-stage-build構建go圖像: 並獲取x509: certificate signed by unknown authority錯誤 我試圖在 X509:由未知機構簽署的證書(在 Docker 容器內運行 Go 應用程序) 和 docke ...

使用 go-git 獲取文件的平面列表

[英]Using go-git to get flat list of files

我正在開發一個列出 .git 存儲庫中所有文件的應用程序。 我有一種將樹變成平面列表的工作方法,但速度非常慢(300 毫秒) 這是 Tree 對象的源代碼https://github.com/go-git/go-git/blob/master/plumbing/object/tree.go 我的 ...

2020-08-26 06:02:57   1   347    go / go-git  
go-git 相當於“git push --all<remote> “</remote>

[英]go-git equivalent to "git push --all <remote>"

在不迭代所有分支的情況下,無法找到一種使用go-git將所有分支推送到遠程的方法。 我查看了PushOptions定義,但沒有看到與git push --all &lt;remote&gt;相關的選項。 有沒有人做到這一點? ...

2020-08-19 19:31:39   1   347    git / go / go-git  
如何創建拉取請求或合並 PR

[英]How to create Pull request or merge PR

我可以將 fetch push 克隆到 repo。 同樣是否可以使用 Go 創建拉取請求或合並 PR? ...

2020-08-04 00:58:53   2   264    git / go / go-git  

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM