Working with Git repositories

From WandoraWiki
(Difference between revisions)
Jump to: navigation, search
(Clone remote repository)
(Starting with a Github repository)
 
Line 25: Line 25:
 
As it was written above, Wandora doesn't limit the content of cloned repository. The cloned repository can be empty or it may contain files that do not belong to the Wandora project. Steps required to start working with a Github repository:
 
As it was written above, Wandora doesn't limit the content of cloned repository. The cloned repository can be empty or it may contain files that do not belong to the Wandora project. Steps required to start working with a Github repository:
  
* First, the user creates a Github repository using tools in Github. Created repository is empty.  
+
* The user creates a Github repository using tools in Github. Created repository is empty.  
* Second, the user uses Wandora application and it's '''Clone remote repository''' tool to copy just created Github repository. As the copied repository is empty and doesn't contain valid Wandora project, user may skip opening the project.  
+
* The user clones just created remote Github repository using Wandora application. As the copied repository is empty and doesn't contain valid Wandora project, user may skip opening the project.  
* Third, the user saves Wandora project into the clone directory. Now the local Github repository directory contains valid Wandora project.  
+
* The user saves Wandora project into the clone directory. Now the local Github repository directory contains valid Wandora project.  
* Now the user can use all other Git tools in Wandora application to commit, push and pull changes back and forth between local project directory and remote Github repository.
+
* Now the user can commit, push and pull changes back and forth between local project directory and remote Github repository using Wandora application.
  
 
== Initialize local repository ==
 
== Initialize local repository ==

Latest revision as of 12:54, 17 October 2017

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.

Contents

[edit] 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.


Git clone.png


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.

[edit] Starting with a Github repository

As it was written above, Wandora doesn't limit the content of cloned repository. The cloned repository can be empty or it may contain files that do not belong to the Wandora project. Steps required to start working with a Github repository:

  • The user creates a Github repository using tools in Github. Created repository is empty.
  • The user clones just created remote Github repository using Wandora application. As the copied repository is empty and doesn't contain valid Wandora project, user may skip opening the project.
  • The user saves Wandora project into the clone directory. Now the local Github repository directory contains valid Wandora project.
  • Now the user can commit, push and pull changes back and forth between local project directory and remote Github repository using Wandora application.

[edit] Initialize local repository

If there is no remote repository and the user wants to keep track of changes, she can initialize local Git repository using menu option File > Git > Initialize local repository.... Menu option creates local Git repository and saves current Wandora project into the repository.

User should notice that Wandora has no tool to transform local repository into remote repository. The user can not push changes from local repository into the remote repository using Wandora's Git tools.

[edit] 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.

[edit] 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.

[edit] Push to remote

Choosing menu option File > Git > Push to remote pushes all local remote changes to the remote repository.

Push works for remote Git repositories only. If the repository was initialized as a local Git repository, push is not supported.

[edit] Pull from remote

Choosing menu option File > Git > Pull from remote updates local repository from the remote remote repository and reverts current project.

Pull works for remote repositories only. If the repository was initialized as a local Git repository, pull is not supported.

[edit] Unsupported Git commands

Wandora supports only small subset of Git commands. To use unsupported Git commands, the user should install any standard Git software package and start using it's commands. Any standard Git software package contains commands that can be used with repositories initialized using Wandora.

[edit] Examples

Github contains several example projects Wandora user can clone:

Personal tools