Skip to content

Commit ed0bcf0

Browse files
committed
Updated README
1 parent 1e140ba commit ed0bcf0

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,51 @@ Git.hub
22
=======
33

44
A simple API in terms of querying github with C#, based on RestSharp.
5+
6+
Usage
7+
-----
8+
9+
### Create a client instance
10+
```csharp
11+
using Git.hub;
12+
Client client = new Client();
13+
```
14+
15+
### login
16+
OAuth token:
17+
```csharp
18+
client.setOAuth2Token("0fd...");
19+
```
20+
21+
Username and Password:
22+
```csharp
23+
client.setCredentials("mabako", "super duper password");
24+
```
25+
26+
Retrieve the currently logged in user:
27+
```csharp
28+
User user = client.getUser();
29+
```
30+
31+
32+
### fetch repositories
33+
```csharp
34+
IList<Repository> repos = client.getRepositories("mabako");
35+
IList<Repository> orgRepos = client.getOrganizationRepositories("github");
36+
37+
Repository pluginSource = client.getRepository("mabako", "Git.hub");
38+
39+
/* Requires login */
40+
IList<Repository> ownRepos = client.getRepositories();
41+
```
42+
43+
### repository actions
44+
Fork the repo:
45+
```csharp
46+
Repository forked = pluginSource.CreateFork();
47+
```
48+
49+
List branches:
50+
```csharp
51+
IList<Branch> branches = pluginSource.GetBranches();
52+
```

0 commit comments

Comments
 (0)