dongwo1234 2019-03-06 23:38
浏览 221
已采纳

将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/github.com/StefanCepa/ . 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.

  • 写回答

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/github.com/StefanCepa/projectOne/
    $ git init
    $ git add .
    $ git commit -m 'init'
    $ git remote add origin https://github.com/StefanCepa/projectOne.git
    $ git push -u origin master
    

    Within project 2:

    *same process as above

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?