forked from DavadDi/go_study
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add go get private repo and fork repo
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## 1 go get 使用私有仓库 | ||
|
||
$ git config --global url."git@github.com:" .insteadOf "https://github.com/" | ||
$ cat ~/.gitconfig | ||
[url "git@github.com:"] | ||
insteadOf = https://github.com/ | ||
## 2 go get 使用fork项目 | ||
|
||
### 2.1 add remote | ||
fork | ||
http://github.com/awsome-org/tool ------> http://github.com/awesome-you/tool | ||
|
||
|
||
$ go get http://github.com/awesome-org/tool | ||
$ git remote add awesome-you-fork http://github.com/awesome-you/tool | ||
|
||
$ git pull --rebase awesome-you-fork | ||
$ git push awesome-you-fork | ||
|
||
### 2.2 cheat "go get" | ||
|
||
cd $GOPATH | ||
mkdir -p {src,bin,pkg} | ||
mkdir -p src/github.com/awesome-org/ | ||
cd src/github.com/awesome-org/ | ||
git clone git@github.com:awesome-you/tool.git # OR: git clone https://github.com/awesome-you/tool.git | ||
cd tool/ | ||
go get ./... | ||
|
||
|
||
link | ||
|
||
* [Forking Golang repositories on GitHub and managing the import path](http://code.openark.org/blog/development/forking-golang-repositories-on-github-and-managing-the-import-path) | ||
* [GitHub and Go: forking, pull requests, and go-getting](http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html) |