======= Using Git for W-phase =======
===== How to use Git =====
Instead of repeating things that were said elsewhere, let us just give some pointers:
* [[http://git-scm.com/download|Download Git]]
* [[http://git-scm.com/|Git Community]]
* [[http://schacon.github.com/git/user-manual.html|Git User Manual]]
===== Make sure your version of Git is OK =====
You need to have a version of Git greater or equal to 1.7.10, thus type:
git --version
and if the version number displayed is 1.7.10 or greater everything is OK, otherwise you need to install a more recent version.
===== One-time configuration for each repository =====
The W-phase package is hosted as a github repository. To clone the W-phase repository:
git clone https://github.com/eost/wphase.git wphase_package
If you have an error like
error: The requested URL returned error: 403 while accessing https://github.com/eost/wphase.git/info/refs
please make sure to update git to version 1.7.10 or later (see above).
===== Regular daily usage: master branch (for regular users) =====
* To update your local copy of the W-phase repository (pull changes from the master branch, i.e., stable version)
cd /to/the/wphase/directory/
git pull origin master
===== Regular daily usage: develop branch (for developers) =====
**If you would like to contribute or if you have any questions/suggestions, [[zacharie.duputel@unistra.fr,luis.rivera@unistra.fr|please contact us]].**
* After cloning the repository, one may want to list existing branches
git branch -a
* To update your local copy of the W-phase repository (pull changes from the develop branch)
git pull origin develop
* master
remotes/origin/HEAD -> origin/master
remotes/origin/develop
remotes/origin/master
Notice the * character that prefixes the "master" branch: it indicates the branch that you currently have checked out.
* If you want to work on the develop branch, you can create a local version using:
git checkout -b develop origin/develop
* To see the last commit on each local branch, you can run
git branch -v
* develop 308999e Enable python3 compatibility in bin/traces_regional.py (...)
master 2f33728 Correction numero de version -> r249
* To switch from one branch to another
git checkout master
or
git checkout develop
* make some changes to any file you want using your favorite editor (in the line below we use vi as an example)
vi some_file.c
* You may want to check what has changed (and thus that will be committed), you can type one or both of these two commands:
git status
git diff
* To prepare the content staged for the next commit, use:
git add files_for_the_next_commit
* You can then commit staged changes locally, adding a short message (one line) explaining what you have changed
git commit -m "log message describing the changes"
* Before pushing the results, you can synchronise and see the local database using
git fetch origin
git branch -a
git branch -v
(etc...)
* You can then push your changes to your GitHub fork
git push origin develop
* To merge develop into the master branch
git checkout master
git merge develop
* To create a new version tag, edit "Version: rXXX" in bin/Arguments.py and bin/RUNA3.csh. You should also add the corresponding tag using:
git tag -a rXXX -m "Short description of this release"
* Listing the available tags in Git is straightforward. Just type
git tag
* You can also see the tag data along with the commit that was tagged by using
git show r252
===== Configure ssh-keys for GitHub =====
https://help.github.com/articles/generating-ssh-keys