1. How to get GitHub oauth-token
-
Login github -> setting -> developer applications
-
redirect by visiting
Name | Type | Description |
---|---|---|
client_id | string | Required. The client ID you received from GitHub when you registered. |
redirect_uri | string | The URL in your app where users will be sent after authorization. See details below about redirect urls. |
scope | string | A ==comma== separated list of scopes. |
state | string | An unguessable random string. It is used to protect against cross-site request forgery attacks. |
About scope
-
get the code from redirect url
-
send
Parameters
Name | Type | Description |
---|---|---|
client_id | string | Required. The client ID you received from GitHub when you registered. |
client_secret | string | Required. The client secret you received from GitHub when you registered. |
code | string | ==Required.== The code you received as a response to Step 1. |
redirect_uri | string | The URL in your app where users will be sent after authorization. See details below about redirect urls. |
state | string | The unguessable random string you optionally provided in Step 1 |
Response By default, the response will take the following form:
access_token=e72e16c7e42f292c6912e7710c838347ae178b4a&scope=user%2Cgist&token_type=bearer
2. How to merge code based on ==pull request==
cd foo
git remote add [foo] git@github.com:[foo]/[foo].git
vim .git/config
[remote "foo"]
url = git@github.com:[foo]/Mango.git
fetch = +refs/heads/*:refs/remotes/[foo]/*
#add fetch = +refs/pull/*/head:refs/remotes/[foo]/pr/*
[remote "foo"]
url = git@github.com:[foo]/Mango.git
fetch = +refs/heads/*:refs/remotes/[foo]/*
fetch = +refs/pull/*/head:refs/remotes/[foo]/pr/*
#save
git fetch remote
3. Install git (Linux)
sudo apt-get install git-core openssh-server openssh-client
ssh-keygen -t rsa
#add ssh to github