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 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题