2019-03-06 23:38
浏览 181

将Go项目上传到GitHub Repository

How can i successfully upload my Go project to existing github repository? Here is how my $GOPATH looks like: /home/user/go.

There I have created the following directories: src/ . And inside that directory I have 2x directories which represent two different projects. I would like each of those projects to be posted on seperate github repository.

Any ideas how can I do that? Commiting stuff written in Go on github is kinda confusing to me.

图片转代码服务由CSDN问答提供 功能建议

我如何成功将Go项目上传到现有的github存储库? 这是我的 $ GOPATH 的样子: / home / user / go

我已经创建了以下目录:< strong> src / / StefanCepa / 。 在该目录中,我有2个目录,分别代表两个不同的项目。 我希望将每个项目发布在单独的github存储库上。

任何想法我该怎么做? 提交在GitHub上用Go语言编写的内容会让我感到困惑。

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douao1858 2019-03-06 23:58

    This is done the same way that you would initialize and commit a new repository regardless of the language.

    Go just makes it a little easier to find your other Go projects thanks to the $GOPATH and the standards of the language. Simple example below.

    Within project 1:

    $ cd ~/go/src/
    $ git init
    $ git add .
    $ git commit -m 'init'
    $ git remote add origin
    $ git push -u origin master

    Within project 2:

    *same process as above

    打赏 评论

相关推荐 更多相似问题