Changes

Jump to navigation Jump to search
1,607 bytes added ,  13:17, 13 December 2017
no edit summary
This page is part of the [[Developer Section]]. It describes how to use [http://git-scm.com/ git] to manage the BaseX sources.
 
==Using Git to contribute to BaseX ==
Our team uses git and [https://github.com GitHub] to manage the source code. All team members have read/write access to the repository, and external contributors are welcome to fork the project.
All team members have read+write access Git makes it easy to retain a full copy of the repositoryfor yourself. To get started and running, external contributors are invitedto simply ''fork the project. '' BaseX:
Git makes it easy # Head over to retain a full copy of the repository for yourselfhttps://github. To get started com and runningcreate an account# Fork https://github.com/BaseXdb/basex, simply fork BaseX.so you have a version on your ownIf forking sounds unfamiliar to you# The forked project can then be cloned on your local machine, we suggest and changes can be pushed back to look up some of the documentation listed at the end of this page.your remote repository
You can then build BaseX with [[Maven]]. ==Using Git & Eclipse is optional.==
<table cellspacing='0' cellpadding='0' width='100%'>
<tr><td valign='top'>
[[File:Git01.png|border|300px|left]]
[[File:Git02.png|border|300px|left]]
[[File:Git03.png|border|300px|left]] [[File:Git04.png|border|300px|left]] [[File:Git05.png|border|300px|left]] [[File:Git06.png|border|300px|left]] [[File:Git07.png|border|300px|left]] [[File:Git08.png|border|300px|left]] [[File:Git09.png|border|300px|left]]
[[File:Git10.png|border|300px|left]]
</td><td width='20'>
</td><td valign='top'>
==Using Git & Eclipse == # (Optional) Head over to https://github.com/BaseXdb and create an account# Fork BaseX, so you have a version on your own# Make yourself familiar with git (see the end of this page)# Open Eclipse# Install egit (Eclipse: ''Help'' → ''Marketplace'' → Search for ''egit'' '''or''' get it from http://www.eclipse.org/egit/) In the '''Package Explorer''' to the left use right-click and choose Import... Select "'''Projects from Git'''" and click Next &gt; ===Clone === Click "'''Clone...'''" to create a local copy of the remote repository. This copy will include the full project history Copy & Paste the github URI in the Location field. If you want to use SSH make sure you provided GitHub with your public key to allow write-access. If in doubt use the HTTPS URI and authenticate yourself with your GitHub credentials.  Select the master branch (or arbitrary branches you like)
* In the '''Package Explorer''' to the left, use right-click and choose '''Import...'''* Select '''Projects from Git''' and click '''Next &gt;'''* Choose the '''Clone''' option to create a local copy of the remote repository. This copy will include the full project history* Copy & Paste the GitHub URI in the Location field. If you want to use SSH, make sure you provided GitHub with your public key to allow write-access. If in doubt, use the https URI and authenticate yourself with your GitHub credentials. The read-only URI of the repository is {{Code|https://github.com/BaseXdb/basex.git}}.* Select the master branch (or arbitrary branches you like) * Now choose a location where the local repository is stored: Create &lt;workspace&gt;'''/repos/BaseX'''and click "'''Finish'''".
===Create the project ===
* Select our newly cloned repository and click Next * Select "'''Import Existing Projects'''" and depending on your Eclipse version enable automatic sharing. More recent versions will not offer this feature as sharing is enabled by default. * Click next to select the Project to import * Check "basex" to checkout and click finish * You are now ready to contribute.
===EGit & SSH===
EGit The Eclipse git plugin uses the [http://www.jcraft.com/jsch JSch] library , which is, however, had [https://bugs.eclipse.org/bugs/show_bug.cgi?id=326526 reported] to have problems with RSA SSH keys ] in linux Linux and possibly other platforms. A solution would be to use If the problem persists, the variable GIT_SSH and assign it a path to the native SSH executablecan be assigned to the {{Cpde|GIT_SSH}} variable. According to [http://egit.eclipse.org/r/#change,2037 this] change in EGit, the plugin will try to use a native SSH implementation instead of JSch (this, however, may not always work either :( ).
==Using Git on Command-Line==
# Choose a directory where the project will be created and make it your working directory (e. g. /home/user/myprojects)
===Clone Your Personal Repository===
<pre class="brush:shell">
Before executing the actual commit, git will open the default shell editor (determined using the $EDITOR variable, usually vi) to enter a message describing the commit changes.
Alternative way is to commit all changed files, i. e. it is not needed to explicitly add explicitly the changed files:
<pre class="brush:shell">
$ git commit -a
</pre>
===Pushing Local Changes to Personal Remote Repository===
<pre class="brush:shell">
</pre>
===Pulling Changes from Personal Remote Repository===
<pre class="brush:shell">
</pre>
===Add BaseXdb Upstream Repository===
The upstream repository is the one from which the BaseX releases are made and the one from which the personal repository was forked.
</pre>
===Pulling Changes from Upstream Repository to Local Repository===
When some changes are made in the upstream repository, they can be pulled to the local repository as follows:
</td></tr></table>
==Need help =Developing a new feature or bug fix=== It is always a good idea to create a new branch for a new feature or a big fix you are working on. So first, let's make sure you have the most up-to-date source code. We assume, that you added BaseX as upstream repository as described above and you are currently in the ''master'' branch: <pre class="brush:shell">$ git pull upstream master</pre> Now, we create a new branch, based on the master branch <pre class="brush:shell">$ git checkout -b new-featureSwitched to a new branch 'new-feature'</pre> Your are now automatically switched to the ''new-feature'' branch. Now you can make all your changes in one or several commits. You can commit all changes using  <pre class="brush:shell">$ git?=commit -a</pre> Now, you want to push these changes to the repository on GitHub. Remember, that up to now your changes just reside on your local drive, so now you want to push it to your remote fork of BaseX. Simply do: <pre class="brush:shell">$ git push origin new-featureCounting objects: 318, done.Delta compression using up to 4 threads.Compressing objects: 100% (107/107), done.Writing objects: 100% (154/154), 22.96 KiB | 0 bytes/s, done.Total 154 (delta 93), reused 81 (delta 26)To git@github.com:$username/basex.git * [new branch] new-feature -> new-feature</pre> You can now use your web browser and go to your fork of BaseX. You will see the following message: [[File:Git11.png]]
===Installing===You can now click the "Compare & pull request" button. You can now review the changes you are going to push.
For information on how to install git on various platforms '''Please review them carefully. Also, please refer give a meaningful comment so we can quickly determine what your changes are doing.''' After clicking the "Create Pull request" button you are done and we will review your changes and either merge the pull request or get back to: [http://help.githubyou.com/git-installation-redirect/ GitHub: git Installation Guide]
===Documentation=Links==
* [http://help.github.com/git-installation-redirect/ GitHub: git Installation Guide]
* [http://help.github.com/ Comprehensive Getting Starting Guide on GitHub]
* [http://book.git-scm.com/index.html The git book]
* [http://gitcasts.com/ Gitcasts.com – Video Guides]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu