Skip to content

Instantly share code, notes, and snippets.

@avence12
Created June 5, 2016 10:27
Show Gist options
  • Save avence12/9d05a662ec76e989e0a5328b2d46e52a to your computer and use it in GitHub Desktop.
Save avence12/9d05a662ec76e989e0a5328b2d46e52a to your computer and use it in GitHub Desktop.
Use GB to manage Github and self-hosted private repository at the same time
  • Add url alias in .gitconfig. Using Bitbucket to distinguish from Github dependencies
$ vim ~/.gitconfig
[url "git@some.private-repo.com:"]
        insteadOf = https://bitbucket.org/
$ gb vendor fetch bitbucket.org/avence12/example_go

$ tree vendor/src/bitbucket.org/avence12/example_go
vendor/src/bitbucket.org/avence12/example_go
└── example_go
    ├── README.md
    └── src
        └── main.go

Note!!

  • You will see some wwarnings when you fetch normal github repo. No worry, the repo is cloned normally.
$ gb vendor fetch github.com/gin-gonic/gin
Gogs: Repository owner does not exist
Unregistered owner: gin-gonic
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
skipping insecure protocol: git://github.com/gin-gonic/gin
  • Alternate way is to modify GB source code, making your private repo valid source and build your own GB bin file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment