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 用PLC设计纸袋糊底机送料系统
  • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
  • ¥15 用C语言输入方程怎么
  • ¥15 网站显示不安全连接问题
  • ¥15 51单片机显示器问题
  • ¥20 关于#qt#的问题:Qt代码的移植问题
  • ¥50 求图像处理的matlab方案
  • ¥50 winform中使用edge的Kiosk模式
  • ¥15 关于#python#的问题:功能监听网页
  • ¥15 怎么让wx群机器人发送音乐