Set up GitHub
To set everything up on GitHub, follow these steps:
- If you don't have one already, create a GitHub account (you can do this for free)
- Sign in to your account on the GitHub.com website
- Also download and install GitHub Desktop. We'll need it later. You'll need to sign in to that as well once it's installed.
Create a repository
A repository, or repo for short, is like a project on GitHub. It's a set of files that you can push and pull to.
Create a new respository for the project you want to collaborate on. Be sure to set your repository to private if you don't want to share it with the whole world. Public repositories are generally used for open-source projects (which your Construct project can be too, if you want it to be). Note there may be limits on how many private repositories or collaborators you can have for free - for up-to-date information see GitHub's pricing page.
Once you've created the repository, some instructions appear for how to set up the repository. The easiest way is to use GitHub Desktop, which we downloaded and installed earlier. This provides a visual tool to handle pushing and pulling changes. There should be a button that says Set up in Desktop. Click that, and you should be prompted to open GitHub Desktop. Go ahead and open it. You'll be prompted to pick a folder on your computer for the repository; make sure you choose a new or empty folder, and then click Clone (GitHub's term for creating a working copy). You should now have your repository open in GitHub Desktop. Currently it's empty though, and GitHub Desktop should say No local changes since nothing has changed yet.
Ignore UI state files
Before we continue, let's make sure those UI state files we previously mentioned are ignored by GitHub. As noted these are specific to you only and you don't want to be submitting changes for them.
To ignore them, in GitHub Desktop choose the menu option Ignored files. Enter
*.uistate.json and click Save. Now all files ending with .uistate.json will be completely ignored by GitHub, so they won't get in the way causing unwanted changes and conflicts.
, then click
Currently there are no files in the repository. Let's add the first set of files.
In Construct, either open your existing project, or create a new empty project. Then choose
You'll be prompted to pick a folder to save your project to. Choose the local folder you chose in GitHub Desktop.
Switch back to GitHub Desktop. It should now have automatically updated. Instead of saying No local changes, there should be a list of all the files you just added on the left. (The picture below was taken after saving a new empty project, but if you used an existing project it will list everything in your project.)
Make sure no .uistate.json files are in the list. If you see any, revisit the section Ignore UI state files above.
Commit the files
Each change is called a commit. This change is to add our first set of files. Every commit must have a summary, so type something in the summary box like Add first files.
Then click Commit to master. (Master is the default branch, but that's a different topic.)
Your changes won't go to the server until you publish them. This way you can queue up several commits and submit them all in one go. However we only have one commit and we want to send it right away, so click Publish branch. It'll spend a moment uploading your files.
Once you're done, go and look at your GitHub repository on the web again, or reload the page if it's still open. You should see your files there! They are now on the server.
Now you're ready to start working with your team!