An easy way to Review Pull Requests from Github in Android Studio
There are multiple steps you need to follow to review pull requests from github in Android Studio:
- Go to Preferences in Android Studio, find Version Control and then inside version control click on Github.
- Here you have multiple options to add github account:
If you want to add Non-enterprise GitHub account then just click on Add Account or ‘+’ sign.
Add Account will take you to github.com to authorized from your account.
From ‘+’ sign you can choose Log In via Github… or Log In with Token…. Log In via Github is same as Add Account.
For Log In with Token, you need to click on Generate button
It should open webpage on Github. Select all the permissions that you seem appropriate and generate token.
After selecting appropriate permission click on generate token button and generate token. Copy the token from the webpage and paste it into your Android studio token field.
Note: This token cannot be retrieved later but you can generate token N number of times and use them.
If you want to add Enterprise Github account then from ‘+’ sign select Log In to Github Enterprise….
Enter the server name like “https://github.example.com/” and then click on generate button to generate token. Rest procedure is the same as above mentioned.
After adding token click Ok and close the window.
View Pull Requests
- For Android Studio before Arctic Fox: on Android studio top menu click VCS -> Git -> View Pull Request
For Android Studio Arctic Fox: On Android studio top menu click Git -> Github -> View Pull Request
- Android studio will open a new window that is pinned to the right of the pane. You can now click on the Open Pull Requests and review PRs.
- Now you can add comments and click on submit review, it will automatically post it on GitHub.
- You will see parallel windows for code difference of each file.
This feature is still improving.