首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在私有存储库上使用build时出错

在私有存储库上使用build时出错
EN

Stack Overflow用户
提问于 2022-11-11 11:14:56
回答 1查看 37关注 0票数 1

我是一个由两个人组成的团队,在大学做作业,我们在github上创建了一个私人存储库,它是从一个公共存储库中克隆出来的。我们使用的是围棋语言,码头和码头写作。GO中的所有导入都来自公共存储库。创建私有存储库的人在尝试构建时不会得到错误,但是我会得到错误,而我不能构建它。我用ssh克隆私有存储库,用ssh代理转发我的密钥。这个公共存储库是“github.com/ucy-335/ is 499-fa22”,go模块名为“github.com/ucy-335/hotel-app/”。私有存储库是github.com/ucy-335/username/ is 499-fa22。我收到以下信息。

代码语言:javascript
复制
go: finding module for package github.com/sirupsen/logrus
go: finding module for package gopkg.in/mgo.v2
go: finding module for package google.golang.org/grpc/reflection
go: finding module for package golang.org/x/net/context
go: finding module for package github.com/ucy-coast/hotel-app/internal/rate/proto
go: finding module for package github.com/golang/protobuf/proto
go: finding module for package google.golang.org/grpc
go: finding module for package google.golang.org/grpc/credentials/insecure
go: finding module for package github.com/ucy-coast/hotel-app/internal/profile/proto
go: finding module for package github.com/ucy-coast/hotel-app/internal/geo/proto
go: finding module for package github.com/hailocab/go-geoindex
go: finding module for package github.com/uber/jaeger-client-go/config
go: finding module for package github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc
go: finding module for package github.com/opentracing/opentracing-go
go: finding module for package google.golang.org/grpc/keepalive
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/opentracing/opentracing-go v1.2.0
go: downloading google.golang.org/grpc v1.50.1
go: downloading github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645
go: downloading github.com/sirupsen/logrus v1.9.0
go: downloading github.com/hailocab/go-geoindex v0.0.0-20160127134810-64631bfe9711
go: downloading golang.org/x/net v0.2.0
go: downloading gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
go: downloading github.com/uber/jaeger-client-go v2.30.0+incompatible
go: found github.com/sirupsen/logrus in github.com/sirupsen/logrus v1.9.0
go: found github.com/opentracing/opentracing-go in github.com/opentracing/opentracing-go v1.2.0
go: found github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc in github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645
go: found github.com/hailocab/go-geoindex in github.com/hailocab/go-geoindex v0.0.0-20160127134810-64631bfe9711
go: found google.golang.org/grpc in google.golang.org/grpc v1.50.1
go: found google.golang.org/grpc/keepalive in google.golang.org/grpc v1.50.1
go: found google.golang.org/grpc/reflection in google.golang.org/grpc v1.50.1
go: found github.com/golang/protobuf/proto in github.com/golang/protobuf v1.5.2
go: found golang.org/x/net/context in golang.org/x/net v0.2.0
go: found google.golang.org/grpc/credentials/insecure in google.golang.org/grpc v1.50.1
go: found github.com/uber/jaeger-client-go/config in github.com/uber/jaeger-client-go v2.30.0+incompatible
go: found gopkg.in/mgo.v2 in gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
go: downloading github.com/stretchr/testify v1.7.0
go: downloading google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013
go: downloading github.com/google/go-cmp v0.5.6
go: downloading google.golang.org/protobuf v1.27.1
go: downloading golang.org/x/sys v0.2.0
go: downloading gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: downloading golang.org/x/text v0.4.0
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/stretchr/objx v0.1.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: finding module for package github.com/ucy-coast/hotel-app/internal/profile/proto
go: finding module for package github.com/uber/jaeger-lib/metrics
go: finding module for package gopkg.in/yaml.v2
go: finding module for package go.uber.org/atomic
go: finding module for package github.com/ucy-coast/hotel-app/internal/geo/proto
go: finding module for package github.com/pkg/errors
go: finding module for package github.com/ucy-coast/hotel-app/internal/rate/proto
go: finding module for package github.com/uber/jaeger-lib/metrics/metricstest
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/uber/jaeger-lib v2.4.1+incompatible
go: downloading go.uber.org/atomic v1.10.0
go: downloading gopkg.in/yaml.v2 v2.4.0
go: found github.com/pkg/errors in github.com/pkg/errors v0.9.1
go: found github.com/uber/jaeger-lib/metrics in github.com/uber/jaeger-lib v2.4.1+incompatible
go: found go.uber.org/atomic in go.uber.org/atomic v1.10.0
go: found github.com/uber/jaeger-lib/metrics/metricstest in github.com/uber/jaeger-lib v2.4.1+incompatible
go: found gopkg.in/yaml.v2 in gopkg.in/yaml.v2 v2.4.0
go: finding module for package github.com/HdrHistogram/hdrhistogram-go
go: finding module for package github.com/ucy-coast/hotel-app/internal/geo/proto
go: finding module for package github.com/ucy-coast/hotel-app/internal/rate/proto
go: finding module for package github.com/ucy-coast/hotel-app/internal/profile/proto
go: downloading github.com/HdrHistogram/hdrhistogram-go v1.1.2
go: found github.com/HdrHistogram/hdrhistogram-go in github.com/HdrHistogram/hdrhistogram-go v1.1.2
go: downloading gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f
go: downloading github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e
go: downloading github.com/kr/text v0.2.0
go: finding module for package github.com/ucy-coast/hotel-app/internal/rate/proto
go: finding module for package github.com/ucy-coast/hotel-app/internal/profile/proto
go: finding module for package github.com/ucy-coast/hotel-app/internal/geo/proto
github.com/ucy-coast/hotel-app/internal/frontend imports
        github.com/ucy-coast/hotel-app/internal/profile/proto: cannot find module providing package github.com/ucy-coast/hotel-app/internal/profile/proto: module github.com/ucy-coast/hotel-app/internal/profile/proto: git ls-remote -q origin in /go/pkg/mod/cache/vcs/25d7ecce62d5217dbfc309e95fa0935ac3442cda3276f618cce8defe7a0cec32: exit status 128:
        fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
github.com/ucy-coast/hotel-app/internal/geo imports
        github.com/ucy-coast/hotel-app/internal/geo/proto: cannot find module providing package github.com/ucy-coast/hotel-app/internal/geo/proto: module github.com/ucy-coast/hotel-app/internal/geo/proto: git ls-remote -q origin in /go/pkg/mod/cache/vcs/25d7ecce62d5217dbfc309e95fa0935ac3442cda3276f618cce8defe7a0cec32: exit status 128:
        fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
github.com/ucy-coast/hotel-app/internal/rate imports
        github.com/ucy-coast/hotel-app/internal/rate/proto: cannot find module providing package github.com/ucy-coast/hotel-app/internal/rate/proto: module github.com/ucy-coast/hotel-app/internal/rate/proto: git ls-remote -q origin in /go/pkg/mod/cache/vcs/25d7ecce62d5217dbfc309e95fa0935ac3442cda3276f618cce8defe7a0cec32: exit status 128:
        fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
ERROR: Service 'profile' failed to build: The command '/bin/sh -c go mod tidy' returned a non-zero code: 1
EN

回答 1

Stack Overflow用户

发布于 2022-11-11 23:15:57

不太确定你的设置,你可以试试这个。

~/.gitconfig文件中添加这些行

代码语言:javascript
复制
[url "ssh://git@github.com/"]
    insteadOf = https://github.com/
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74401660

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档