Repository: incubator-mynewt-site Updated Branches: refs/heads/master b568e4660 -> bf9737dec
doc about accessing a private repo Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/c65a7b24 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/c65a7b24 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/c65a7b24 Branch: refs/heads/master Commit: c65a7b243823dc6878341af3df6a565432723afb Parents: b568e46 Author: aditihilbert <ad...@runtime.io> Authored: Mon Feb 13 16:57:34 2017 -0800 Committer: aditihilbert <ad...@runtime.io> Committed: Mon Feb 13 16:57:34 2017 -0800 ---------------------------------------------------------------------- docs/os/tutorials/repo/private_repo.md | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/c65a7b24/docs/os/tutorials/repo/private_repo.md ---------------------------------------------------------------------- diff --git a/docs/os/tutorials/repo/private_repo.md b/docs/os/tutorials/repo/private_repo.md new file mode 100644 index 0000000..0e64b3b --- /dev/null +++ b/docs/os/tutorials/repo/private_repo.md @@ -0,0 +1,47 @@ +## Accessing a private repository + +To access a private repository, newt needs to be configured with one of the following: + +* Access token for the repository +* Basic auth login and password for the user + + +**NOTE:** To create a github access token, see [ +https://help.github.com/articles/creating-an-access-token-for-command-line-use/](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) + +There are two ways to specify this information, as shown below. In +these examples, both a token and a login/password are specified, but you +only need to specify one of these. + +1\. project.yml (probably world-readable and therefore not secure): + +```hl_lines="6 7 8" + repository.my-private-repo: + type: github + vers: 0-dev + user: owner-of-repo + repo: repo-name + token: '8ab6433f8971b05c2a9c3341533e8ddb754e404e' + login: githublogin + password: githubpassword +``` + +2\. $HOME/.newt/repos.yml + +```hl_lines="2 3 4" + repository.my-private-repo: + token: '8ab6433f8971b05c2a9c3341533e8ddb754e404e' + login: githublogin + password: githubpassword +``` + +If both a token and a login+password are specified, newt uses the token. +If both the project.yml file and the private repos.yml file specify +security credentials, newt uses the project.yml settings. + +**NOTE:** When newt downloads the actual repo content, as +opposed to just the repository.yml file, it does not use the same +mechanism. Instead, it invokes the git command line tool. This is an +annoyance because the user cannot use the same access token for all git +operations. This is something that will be fixed in the future. +