Support > Tutorial (R7) > Development with the team > Usage example of Git
ja | en

I will explain the procedure of repository sharing using version control system Git.

Git is known as "distributed version control system".Since it is open source software, it can be downloaded and used free of charge.

Here I will show you how to manage Wagby's repository using Git.

Git offers many functions.Here we will tell you the image of using Git on the page, but please read the guide published on the book or the internet for the features and detailed usage of Git.
Questions about how to use Git are not accepted with Jasmine Software Support.Please note.

Git operates in two stages of "local repository" and "remote repository".Developers first manage objects with "local repositories".You can share it with other developers by pushing it to the remote repository.The fact that other developers get the latest information from the remote repository is called pull.

Figure 1 Relationship between local repository and remote repository
Here, the "repository" is not Wagby's design information, it refers to the folders and files that Git manages.Specifically, it is the Wagby - 7.xx / repository folder and the Wagby - 7.xx / customize folder.

Git Repository

You can also run Git's "remote repository" at your company.Specifically, install Git's server software on Linux OS or Windows Server.However, as the procedure is complicated and many remote repository services are published on the Internet, we will explain with the policy to utilize the remote repository already provided in this document.

Representative Git repositories available on the Internet are as follows.

Service nameCharacteristic
GitHub Most famous.It can be used free of charge, but all registered contents are released.For private use, it will be paid.
Bitbucket Offered by Atlassian company.We also offer Git client "SourceTree" described below free of charge.In the free version you can share repositories up to 5 users.
CloudForge Number of private repository creations No limit, no limit on the number of users.Free up to 2 GB.
Backlog Operation by Japanese companies.There is no free version.Cooperation with ticket management service provided by the company.
It is the result of the survey as of November 2014.For the latest content, please check each service directly.

In the following explanation, I will explain it using Bitbucket.

Using Bitbucket

BitbucketIs a Git repository service provided by Atlassian.

First, create an account.

Figure 2 Creating an account in Bitbucket

Create an empty repository.The repository name you enter here uses letters.We will prepare a repository (Bitbucket) for each project.

Figure 3 Preparing an empty repository
Japanese can not be used as repository name.

After creating the repository, we also obtain the Git client software "SourceTree" at this timing.This is a tool for operating Git which runs on Windows / Mac OS X.It can be used free of charge.

In the explanation below, this SourceTree is used for operation.

Figure 4 Obtain SourceTree

Install SourceTree

Before installing SourceTree,Wagby has already been installed and has done a build processPlease.

After SourceTree installation, register the managed files in the remote repository as follows.

  1. Create local repository
  2. Specify version control exclusion file
  3. Commit of version control target file
  4. Associate with remote repository
  5. Push to remote repository
Figure 5 Relationship between working folder, local repository, remote repository

After installing SourceTree, first create a local repository.

We will set the repository type to "Git". The save destination path (working folder) is the Wagby installation folder. You can name the repository.Japanese is available.

Figure 6 Creating a local repository

At this stage, it is as follows.

RepositorySituation
Remote repositorySky
Local RepositorySky
Work folderThere are many uncommitted files.
Figure 7 State immediately after creation of local repository

Specify version control exclusion file

Specify "repository-specific ignore list".

Figure 8 "Repository-Specific Ignore List" Setting

In the text editor, register the following in the .gitignore file.

.classpath .project .settings / export / LICENSE.pdf misc / repository / branches / repository / trunk _ * / upload_dir / version.txt wagbyapp / wagbyapp.zip wagbydesigner / wagby - licensekey.xml

By doing this, repository / trunk, customize is managed, and all others are excluded from version management.

Work before commit (index registration)

Check "Files of working tree".

It corresponds to the git add command.
Figure 9 Check the working tree file

Click the commit button.

It corresponds to the git commit command.
Figure 10 Commit Button

After entering the commit log, commit.We will log the logs frequently.

Figure 11 Fill in the commit log and commit

After committing, you can check the status by selecting the "Log" tab at the bottom of the screen. At this time, you can see that the branch master has been created.

Figure 12 Branch master created

At this stage, it is as follows.

RepositorySituation
Remote repositorySky
Local RepositorySynced to working folder.
Work folderAll managed files have been committed.
Figure 13 State immediately after the first commit

It connects to the remote repository (Bitbucket) on the Internet side.Start remote setting.

Figure 14 Remote setting (1)

Perform detailed setting of remote repository.

  • Check "Default remote".
  • Enter "https://bitbucket.org/${accout}/${repository}.git" as "URL / Pass".
    • $ {Account} inputs Bitbucket's account.
    • $ {Repository} inputs the repository name created in Bitbucket.

For example, if the account is taro_jasmine and the registered repository name is customer, it is as follows.

https://bitbucket.org/taro_jasmine/customer.git
It corresponds to the command git remote add origin $ {URL}.
Figure 15 Remote Configuration (2)

When work is completed, "origin" is displayed remotely.The association is now complete.

Figure 16 Remote 'origin' is provided

Push to remote repository

Click the "push" button.In the dialog displayed after that, check "Push target".

This corresponds to the git push command.
Figure 17 Pressing the push button

"Origin / master" indicating that it was reflected in the remote repository is displayed.

Figure 18 Reflecting on remote repository

You can check also on Bitbucket's site.

Figure 19 Confirmation at Bitbucket site

After pushing, it is as follows.

RepositorySituation
Remote repositorySynced to working folder.
Local RepositorySynced to working folder.
Work folderSynchronized with both remote repository and local repository.
Fig. 20 Status after push

Let's change the design information when the synchronization is established. Here we have created a new customer model.

Figure 21 Creating customer model

The customer model definition is provided in the repository / trunk / customer folder.Commit this folder.Specifically, do the following operations.

  1. Check "File in working tree".
  2. Click "Commit" button.After entering the commit log, it is committed.(Register to local repository)
  3. You can push it to the remote repository if necessary.(Register to remote repository)
Figure 22 Reflecting changes

When you modify an existing file

You can check the changes on SourceTree screen.(The figure shows the case where the name is required and the input size is 20.)

Figure 23 Checking changes

If you use Git, the flow will be as follows.

Figure 23 Development cycle

The procedure for using the remote repository set this time by another developer is as follows.

  1. Install Wagby (also build it)
  2. Delete files and folders managed by remote repository.
    • repository/trunk
    • customize
  3. Create a local repository.It does not designate and commit version control exclusion file.
  4. Associate with the remote repository.
  5. Pull from the remote repository.Do not commit "merge changes immediately" at this time.
  6. Reload the repository with WagbyDesigner.

Git introduced here has the advantage that remote repositories are prepared on the Internet, making it easier for developers to share even if they are at remote locations.In addition, various functions are provided that demonstrate its effect in the case where customization code is branched and developed in a complicated manner.For details, please read Git's books etc.

On the other hand, learning difficulty of subversion and cvs is not high compared with Git.If you are using a version control system for the first time, you may start with subversion.You can also refer to the guidelines in this document when introducing subversion.(Please do the exclusion file specification etc in the same way.)