Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 9f9b1b9

Browse files
Merge branch 'master' into fixes/secure-keychain-adapter
2 parents 2f9cbbe + ef2f84b commit 9f9b1b9

File tree

6 files changed

+110
-47
lines changed

6 files changed

+110
-47
lines changed

README.md

Lines changed: 92 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ The GitHub for Unity extension brings [Git](https://git-scm.com/) and GitHub int
88

99
**Please note:** this software is currently alpha quality. Please refer to the [list of known issues](https://github.com/github-for-unity/Unity/issues?q=is%3Aissue+is%3Aopen+label%3Abug), and make sure you have backups of your work before trying it out.
1010

11-
![GitHub for Unity screenshot](https://unity.github.com/assets/unity-screenshot.png)
12-
13-
## Where can I get it?
14-
15-
[Releases](https://github.com/github-for-unity/Unity/releases)
16-
1711
## Installing GitHub for Unity
1812

1913
### Requirements
@@ -22,8 +16,98 @@ The GitHub for Unity extension brings [Git](https://git-scm.com/) and GitHub int
2216

2317
### Installation
2418

25-
- Create a new Unity project.
26-
- Download the latest release from the [releases page](https://github.com/github-for-unity/Unity/releases) and double-click the unitypackage file. The package will install itself into the project currently opened in Unity, and Unity will automatically load it once all the files are in the project.
19+
To install the extension, download the latest package from [the releases page](https://github.com/github-for-unity/Unity/releases) and double click on it.
20+
21+
#### Opening the GitHub window
22+
23+
You can access the GitHub window by going to Windows -> GitHub. The window opens by default next to the Inspector window.
24+
25+
#### Initialize Repository
26+
27+
![Initialize repository screenshot](https://user-images.githubusercontent.com/121322/27644875-7fc6302a-5bd9-11e7-98d0-c09b2e450503.png)
28+
29+
If the current Unity project is not in a Git repository, the GitHub for Unity extension will offer to initialize the repository for you. This will:
30+
31+
- Initialize a git repository at the Unity project root via `git init`
32+
- Initialize git-lfs via `git lfs install`
33+
- Set up a `.gitignore` file at the Unity project root.
34+
- Set up a `.gitattributes` file at the Unity project root with a large list of known binary filetypes (images, audio, etc) that should be tracked by LFS
35+
- Configure the project to serialize meta files as text
36+
- Create an initial commit with the `.gitignore` and `.gitattributes` file.
37+
38+
#### Authentication
39+
40+
To set up credentials in Git so you can push and pull, you can sign in to GitHub by going to `Window` -> `GitHub` -> `Account` -> `Sign in`. You only have to sign in successfully once, your credentials will remain on the system for all Git operations in Unity and outside of it. If you've already signed in once but the Account dropdown still says `Sign in`, ignore it, it's a bug.
41+
42+
![Authentication screenshot](https://user-images.githubusercontent.com/121322/27644895-8f22f904-5bd9-11e7-8a93-e6bfe0c24a74.png)
43+
44+
#### Publish a new repository
45+
46+
1. Go to [github.com](https://github.com) and create a new empty repository - do not add a license, readme or other files during the creation process.
47+
2. Copy the **https** URL shown in the creation page
48+
3. In Unity, go to `Windows` -> `GitHub` -> `Settings` and paste the url into the `Remote` textbox.
49+
3. Click `Save repository`.
50+
4. Go to the `History` tab and click `Push`.
51+
52+
#### Commiting your work - Changes tab
53+
54+
You can see which files have been changed and commit them through the Changes tab. `.meta` files will show up in relation to their files on the tree, so you can select a file for comitting and automatically have their `.meta`
55+
56+
![Changes tab screenshot](https://user-images.githubusercontent.com/121322/27644933-ab00af72-5bd9-11e7-84c3-edec495f87f5.png)
57+
58+
#### Pushing/pulling your work - History tab
59+
60+
The history tab includes a `Push` button to push your work to the server. Make sure you have a remote url configured in the `Settings` tab so that you can push and pull your work.
61+
62+
To receive updates from the server by clicking on the `Pull` button. You cannot pull if you have local changes, so commit your changes before pulling.
63+
64+
![History tab screenshot](https://user-images.githubusercontent.com/121322/27644965-c1109bba-5bd9-11e7-9257-4fa38f5c67d1.png)
65+
66+
#### Branches tab
67+
68+
![Branches tab screenshot](https://user-images.githubusercontent.com/121322/27644978-cd3c5622-5bd9-11e7-9dcb-6ae5d5c7dc8a.png)
69+
70+
#### Settings tab
71+
72+
You can configure your user data in the Settings tab, along with the path to the Git installation.
73+
74+
Locked files will appear in a list in the Settings tab. You can see who has locked a file and release file locks after you've pushed your work.
75+
76+
![Settings tab screenshot](https://user-images.githubusercontent.com/121322/27644993-d9d325a0-5bd9-11e7-86f5-beee00e9e8b8.png)
77+
78+
#### Windows
79+
80+
The GitHub for Unity extension ships with a bundle of Git and Git LFS, to ensure that you have the correct version. These will be installed into `%LOCALAPPDATA%\GitHubUnityDebug` when the extension runs for the first time.
81+
82+
You can open a command line with the same Git and Git LFS version that the extension uses by going to the GitHub -> Command line menu.
83+
84+
Make sure a Git user and email address are set in the `%HOME%\.gitconfig` file before you initialize a repository for the first time. You can set these values by opening your `%HOME%\.gitconfig` file and adding the following section, if it doesn't exist yet:
85+
86+
```
87+
[user]
88+
name = Your Name
89+
email = Your Email
90+
```
91+
92+
##### Log files
93+
94+
The extension log file can be found at `%LOCALAPPDATA%\GitHubUnityDebug\github-unity.log`
95+
96+
#### macOS
97+
98+
The current release has limited macOS support. macOS users will need to install the latest [Git](https://git-scm.com/downloads) and [Git LFS](https://git-lfs.github.com/) manually, and make sure these are on the path. You can configure the Git location in the Settings tab on the GitHub window.
99+
100+
Make sure a Git user and email address are set in the `~/.gitconfig` file before you initialize a repository for the first time. You can set these values by opening your `~/.gitconfig` file and adding the following section, if it doesn't exist yet:
101+
102+
```
103+
[user]
104+
name = Your Name
105+
email = Your Email
106+
```
107+
108+
##### Log files
109+
110+
The extension log file can be found at `~/.local/share/GitHubUnityDebug/github-unity.log`. This is a temporary location and will be changed in the future.
27111

28112
## I have a problem with GitHub for Unity
29113

docs/contributing/readme.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/contributing/roadmap.md

Whitespace-only changes.

docs/contributing/setup.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ resources to get familiar with how things work:
1010

1111
- **[How Can I Contribute?](../CONTRIBUTING.md#how-can-i-contribute)** -
1212
details about how you can participate
13-
- **[Development Environment Setup](contributing/setup.md)** - everything
14-
you need to know to get Desktop up and running
13+
- **[How To Build](contributing/how-to-build.md)** - learn how to build the
14+
application
1515
- **[Style Guide](contributing/styleguide.md)** - notes on the coding style
1616
- **[Tooling](contributing/tooling.md)** - if you have a preferred IDE,
1717
there's some enhancements to make your life easier

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/AuthenticationView.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using UnityEngine;
33
using UnityEditor;
44

@@ -26,6 +26,7 @@ class AuthenticationView : Subview
2626
[NonSerialized] private bool need2fa;
2727
[NonSerialized] private bool busy;
2828
[NonSerialized] private string message;
29+
[NonSerialized] private bool enterPressed;
2930

3031
[NonSerialized] private AuthenticationService authenticationService;
3132
private AuthenticationService AuthenticationService
@@ -73,6 +74,8 @@ public override void OnHide()
7374

7475
public override void OnGUI()
7576
{
77+
HandleEnterPressed();
78+
7679
scroll = GUILayout.BeginScrollView(scroll);
7780
{
7881
Rect authHeader = EditorGUILayout.BeginHorizontal(Styles.AuthHeaderBoxStyle);
@@ -116,6 +119,16 @@ public override void OnGUI()
116119
GUILayout.EndScrollView();
117120
}
118121

122+
private void HandleEnterPressed()
123+
{
124+
if (Event.current.type != EventType.KeyDown)
125+
return;
126+
127+
enterPressed = Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.KeypadEnter;
128+
if (enterPressed)
129+
Event.current.Use();
130+
}
131+
119132
private void OnGUILogin()
120133
{
121134
GUILayout.Space(3);
@@ -142,7 +155,7 @@ private void OnGUILogin()
142155
if (busy) GUI.enabled = false;
143156
GUILayout.BeginHorizontal();
144157
GUILayout.FlexibleSpace();
145-
if (GUILayout.Button(loginButton))
158+
if (GUILayout.Button(loginButton) || (GUI.enabled && enterPressed))
146159
{
147160
GUI.FocusControl(null);
148161
busy = true;
@@ -185,7 +198,7 @@ private void OnGUI2FA()
185198

186199
GUILayout.Space(Styles.BaseSpacing);
187200

188-
if (GUILayout.Button(twofaButton))
201+
if (GUILayout.Button(twofaButton) || (GUI.enabled && enterPressed))
189202
{
190203
GUI.FocusControl(null);
191204
busy = true;

0 commit comments

Comments
 (0)