What is GitHub?
GitHub is a web service to help you organize and manage your projects. At its core, it runs a version control system called git. As git is not user friendly enough for most users, GitHub Inc. created a web interface and backend for git, making it much easier to use and extending its features. As of June 2018, over 57 million projects were hosted on GitHub. On June 4, 2018, Microsoft announced it had reached an agreement to acquire GitHub.
Advantages of using GitHub are:
- Version Control: Each change to your project is recorded. You can see when changes were made and by who.
- Branching: You can checkpoint a project at a certain point and easily go back to that point. For example, you could have an experimental branch without disturbing the main project.
- Issues: You can track bugs and the work to be done on the project.
- Milestones: You can group your issues in milestones, with a due date.
- Developers: If there are multiple developers on a project, GitHub makes sure they do not overwrite each others work. It also allows the team to communicate effectively with one another.
- Backup: You will now have another backup of your project.
- Replication: Want to install your project to another system? You can clone it anywhere there is an internet connection.
GitHub is free for public and open source projects. The cheapest paid plan is Developer for $7/month, which includes Personal account, unlimited public repositories, unlimited private repositories and unlimited collaborators.
Setting up GitHub
1. Open a GitHub account. There are a lot of options - but you don't have to worry about all of them to get started. They make it as easy as possible, with lots of help on the site.
2. Download the GitHub Desktop. Both Windows and MacOS are supported.
3. Using the GitHub Desktop, log into your GitHub account.
Using GitHub with AppStudio
Starting with AppStudio 7, any AppStudio projects can be loaded into GitHub. Here's how to do some common operations:
Add an Existing AppStudio Project to GitHub
1. In the GitHub Desktop, choose "New Repository..." from the File menu. Enter the name of your project folder, including ".appstudio" into Name. "Local Path" should contain the directory your project folder is in. Click on "Create Repository".
2. The repository will now appear in the GitHub Desktop. Click on "Publish repository" at the top right of the screen. It will ask to confirm that you want to publish the repository, then it will upload it to the GitHub website.
3. You can now go to the GitHub website and see your project there. You can see the directories and files which make up your project. Explore some of the options and features.
Modifying an AppStudio App
Now that we have our project in a GitHub repository, what happens if we modify our app? Let's add a script to a button in AppStudio and save the project. Here is the updated Github Desktop. Notice that two files have changed: Button1.json now has a link to the script, and Form1.bas has the new code.
Review your changes here to make sure they are what you want, fill in a description and "Commit to master". When you are ready to push all your changes to the GitHub website, click on "Push origin" at the top of the screen.
Have a look at the History tab in GitHub Desktop. You will see the changes you have made to the project. If another developer also made changes to the project, those changes will appear as well. It's an easy way to see what your collaborators have been up to.