将Go项目上传到GitHub Repository

Ste*_*jic -4 github go

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

在那里,我创建了以下目录:src/github.com/StefanCepa/。在该目录中,我有2个目录,分别代表两个不同的项目。我希望将每个项目发布到单独的github存储库中。

有什么想法我该怎么做?提交用github上Go语言编写的内容对我来说有点困惑。

way*_*tta 5

无论使用哪种语言,都可以使用与初始化和提交新存储库相同的方式来完成此操作。

借助$ GOPATH和语言标准,Go使得查找其他Go项目更加容易。下面的简单示例。

在项目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
Run Code Online (Sandbox Code Playgroud)

在项目2中:

*与上述过程相同