Git Integration in the IDE

From Appmethod Topics
Jump to: navigation, search

Go Up to History Manager

The Version Insight feature integrates support for the Git version control system into the IDE.

For more information about Git, see http://www.git-scm.com/

Features of Git in the IDE

For any file that is managed by Git:

  • The History Manager displays both the local file history information and the Git history information. For example, Git comments and history are available on the Information tab of the History Manager.
  • You can compare or diff versions of the file that were created in and are managed by an external Git system, even if the file was not created or backed up by the IDE.
  • You can perform common Git commands such as:
    • Commit (Git) (send your local changes to your local repository)
    • Show Log (click the Information tab on the History Manager)
    • Diff (compare two versions of a file)
    • Blame (Annotate) (displays most recent revision number; click Annotate2.png on the History Manager)

Git Commands in Appmethod

If you are familiar with Git, take a look at this useful table that describes how to perform common Git tasks in the Appmethod IDE.

Enabling Git in Appmethod

Git support is not enabled by default. To enable Git in the IDE, use the following steps:

  1. Download and install Git in your system.
  2. In the IDE, go to Tools > Options > Version Control > Git.
  3. Insert the path to the installed Git executable (git.exe) in your system. For instance, in a Windows system the Git executable is located in:
    C:\Program Files (x86)\Git\cmd\git.exe
  4. Change other parameters as you need.
  5. Click OK to close the wizard.

To implement the Git features, the IDE does not add anything to your project. Instead, the IDE simply uses the Git information that is stored in your local repository (under the version control system).

Git Setup

Once you have Git on your system, you need to set your user name and e-mail address. Git uses the user name and the e-mail address in every Git commit.

To set your user name and e-mail address:

  1. Open the Git Bash utility installed or the command line (see Enabling Git in Appmethod).
  2. Type the following commands:
    git config --global user.name "Git User"
    git config --global user.email "gituser@example.com"
  3. Check your new settings by typing:
    git config --list

Update Your Local Repository

To avoid a conflict between versions, always do an update on your local files before you start making changes:

  1. Open the Git Bash utility installed or the command line (see Enabling Git in Appmethod).
  2. Navigate to the local folder for your repository.
  3. Type the following command:
    git pull
  4. Authenticate in the remote repository if needed.
NOTE: If you are using the last revision of the files under the version control, you will get the following message: Already up-to-date.

Troubleshooting Using Git

Unknown Error when Committing a Change

If your Git environment is not properly set up (you have not provided a user name and/or an e-mail) you get the following error when trying to commit.

ErrorGitCommit.png

Enter the commands provided in Git Setup to commit your changes to your local repository.

Cannot Retrieve Content from Your Remote Repository

If your remote Git repository needs authentication, you need to clone the data from the command line. See Clone a Copy of a Repository That Needs Authentication.

Topics

Equivalent commands

Repository Actions

Log and History Actions

Difference View Actions

Reverting Changes

Dialog Boxes and Panes

See Also