Git Integration

Description

Change any Project to a Git Repository with a click of a button.

Discussion

Git and GitHub support is integrated into the Web Projects Control Panel. When the Web Projects Control Panel is displayed, you will see a Git icon on the far right-hand side of the toolbar in the Control Panel.

You must install Git on your machine to use this feature. Git is a free install. You can find the installer at: git-scm.com/downloads. When you install Git be sure to select the option that adds Git to your path. See Installing Git below for detailed installation instructions.

Converting an Existing Project to a Git Repository 

You can make an existing project into a Git repository by clicking the Git icon.

This will display the Git Menu dialog as shown in the image below.

You can make the current project into a Git Repository by clicking on the Yes - Make a Git Repository button, or you can clone an existing GitHub repository.

If you convert a large Web project into a Git repository, (and you check the Add all files checkbox prompt shown in the image above) Git may take a significant amount of time to add all of the files to the Repository.

Adding and Committing Files 

Once you have made your Web project into a Git repository the Web Control Panel will show a Git toolbar under the main toolbar shown in the Window.

Once you have made your Web project into a Git repository the Web Control Panel will show a Git toolbar under the main toolbar shown in the Window.

The Git toolbar shows you the number of Untracked and Modified files in your project.

Untracked files are files that are not included in the Git repository. This includes new files or files that have been renamed.

Modified files are files that are included in the Git repository. Modified files include files that have been changed or missing. A file can become missing if it has been deleted or renamed.

To commit any modified files, or to add untracked files to your repository, click the Git button on the toolbar, or click directly on the Untracked files or Modified files message on the Git toolbar.

When you click the Git button you will see the Git Commit window where you can select which files you want to commit and which currently untracked files you wish to start tracking. You must enter a commit message before you can click the Commit button.

Once you have committed files, the modified files and untracked files count in the Git toolbar will update.

Connecting your Git Repository to GitHub 

You can connect your local Git repository to a remote GitHub repository. Once you have done this you will be able to push and pull to and from the GitHub repository using the Push to GitHub and Pull from GitHub hyperlinks on the Git toolbar.

In order to connect your repository to a remote Git repository, click the Git Settings hyperlink in the Git toolbar.

First, select the Save User ID and password for GitHub to enter your credentials for your GitHub account.

Next, select the Register/change remote GitHub repository command. This will open a dialog (shown below) where you can enter the URL for your remote GitHub repository.

You must have your own GitHub account to push and pull changes to a repository on GitHub. Visit GitHub to sign-up.

Enter the URL for the GitHub repository in the text box.

Editing the .gitignore File 

Your web project may have certain files that you do not wish to be part of your Git repository. The list of files and file types that you want to ignore is defined in the .gitignore file. You can edit the .gitignore file by selecting the Edit the .gitignore file from the Git Settings menu.

Adding a New Project as a Git or GitHub Repository 

When you create a new Web Project (by clicking the New Project button in the Web Control Panel), you can specify if the new project should be a Git repository.

You can also create a new project from a remote GitHub repository.

Installing Git 

  1. Before you can use Git with Alpha Anywhere, you must first Install Git. Go to git-scm.com.

  2. Click "Downloads".

  3. Select "Windows" to download the Git installer for Windows. Your download should begin automatically.

  4. When the download completes, run the Git installer.

  5. On the Select Components, keep the default settings.

  6. On Choosing the default editor used by Git, you can optionally select a different editor. The editor is used from the Command Line primarily when resolving merge conflicts and entering commit messages with Git. The default, Vim, is a difficult editor to use. If you plan to use Git outside of Alpha Anywhere, it's recommended that you install a text editor such as Notepad++ or Visual Studio Code.

    If you only plan to use Alpha Anywhere with Git, you can leave the default here as Alpha Anywhere will provide its own interface for working with Git. You can always change this setting later.

  7. On Adjusting your PATH environment select "Git from the command line and also from 3rd-party software". This will add Git to the PATH environment variable, which is required to use Git with Alpha Anywhere.

    If you plan to use Git in windows Command Prompt, you can optionally select instead "Use Git and optional Unix tools from the Command Prompt". This will add Unix tools to the PATH variable in addition to Git, allowing you to use Unix tools such as "" and "" in Windows Command Prompt. Visit "" to learn more. Do not select the first option.

  8. Use the default setting on Choosing the SSH executable.

  9. On Choosing HTTPS transport backend, select "Use the native Windows Security Channel library".

  10. On Configuring the line ending conversions select "Checkout as-is, commit as-is".

  11. Use the default setting on Configuring the terminal emulator to use with Git Bash.

  12. On Configuring extra options uncheck all three options.

  13. Click Install. When installation completes, Git can now be used in Alpha Anywhere.

  14. Close and restart Alpha Anywhere if it was running while your were installing Git. You need to do this because the Git installation modified the PATH environment variables, which are cached when Alpha Anywhere launches.

How to Clone an Alpha Anywhere Sample Application from GitHub 

  1. Go to https://github.com/alphaanywhere

  2. Click on "Repositories"

  3. Select a Repository that is labelled as "Works with Git in Alpha Anywhere".

  4. Copy the repository URL from the Address bar

  5. In your Alpha Anywhere workspace, create a new project on the Web Projects Control Panel (File > New Project).

  6. Select the Create Project from a GitHub Repository radio button.

  7. Enter a name for your new project.

  8. Paste the URL you copied in the URL box.

  9. Click OK to create your project.

    Depending on your network connection and the size of the repository, it may take some time to clone the project locally.

Limitations

Web Projects Control Panel Only