Working with Git repositories
Wandora application supports small subset of Git commands. Wikipedia describes Git as a version control system for tracking changes in computer files and coordinating work on those files among multiple people. It is primarily used for source code management in software development, but it can be used to keep track of changes in any set of files. As a distributed revision control system it is aimed at speed, data integrity, and support for distributed, non-linear workflows. Wandora's Git support allows the user to
- Clone remote repository and optionally open cloned repository as a Wandora project.
- Initialize local repository and save current project into the initialized repository.
- Save current project into a local repository and commit changes.
- Save current project into a local repository and both commit and push changes to a remote repository.
- Pull changes from remote repository and reopen current project in Wandora.
Next chapters focus each of these Git commands separately. Git commands locate under menu File > Git.
Clone remote repository
Cloning a remote repository is perhaps the most common method to start working with a Git repository. Cloning copies remote repository to user's computer into a user defined directory. Wandora assumes the cloned repository contains a Wandora project including options.xml and layer folders, each containing one topic map file or topic map specification file. It should be noted that Wandora doesn't limit repository content. Cloning a remote Git project starts with a menu option File > Git > Initialize by cloning a remote repository.... The menu option opens a dialog window as shown below.
Before Wandora can clone a remote repository, user must enter the clone url and local directory for the repository. Optionally the user may enter username and password if the remote repository requires credentials. Credentials may be necessary if the user wishes to commit and push changes back to the remote repository. Finally the user may choose to open cloned repository after clone finishes. Remote repository can be opened only if the cloned repository is a valid Wandora project. If cloned repository is not valid Wandora project and the user has selected to open the cloned project, Wandora views an error dialog .
Once the user has cloned a remote repository, the local directory contains copies of remote files. Cloned repository files in the local directory can now be changed with Wandora application and manually.
Commit and push to remote
To save all changes to the remote repository, Wandora user can choose menu option File > Git > Commit and push to remote.... The menu option saves current project to the local directory, adds and commits changes to the local repository, and pushes changes to the remote repository.
User should notice that all manual changes are committed and pushed too.
If current project is not a Git repository, Wandora views message: Current project is not a git repository. Initialize the git repository first.
Commit to local
Choosing menu option File > Git > Commit to local saves Wandora project to the local project directory and commits all changes to the local repository.
Push to remote
Choosing menu option File > Git > Push to remote pushes all local remote changes to the remote repository.
Pull from remote
Choosing menu option File > Git > Pull from remote updates local repository from the remote remote repository and reverts current project.