2019-03-06 23:38

将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.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • douao1858 douao1858 2年前

    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

    点赞 评论 复制链接分享