作为Go的初学者,我不知道initGit 在哪里.
这里的文档https://golang.org/doc/code.html似乎在早期的hello目录之外建议,然后告诉我git init在hello目录中运行.
对此提出任何建议都是有用的.
这个例子很清楚:
$ cd $GOPATH/src/github.com/user/hello
$ git init
Run Code Online (Sandbox Code Playgroud)
您在项目'hello'中初始化repo.
那样:
你可以将它推送到你的GitHub仓库(你需要先在GitHub上创建,空):
git remote add origin https://<user>@github.com/<user>/hello
git push -u origin master
Run Code Online (Sandbox Code Playgroud)你的项目是"go gettable"
go get github.com/<user>/hello
# that would clone and compile the project in `$GOPATH/src/github.com/<user>/hello`.
Run Code Online (Sandbox Code Playgroud)在.git你看到的外面 hello(在同一页面上)是另一个项目:
src/
github.com/golang/example/
.git/ # Git repository metadata
hello/
hello.go # command source
Run Code Online (Sandbox Code Playgroud)
在这里,该项目是' example'并包括几个包,包括hello一个.
| 归档时间: |
|
| 查看次数: |
750 次 |
| 最近记录: |