Note: You are currently viewing documentation for Moodle 3.6. Up-to-date documentation for the latest stable version of Moodle is likely available here: Git for developers.

Development:Git for developers: Difference between revisions

From MoodleDocs
(New page: This document are for purpose to make you start super quickly (in the hour) with GIT. It doesn't have for purpose to explain you GIT. Please have a look to the real 1. Go on [https://gith...)
 
No edit summary
Line 9: Line 9:
4. Now the technical part, you will need to setup your SSH public key, so you can push to your github repository from your local repository. On mac you get go on this [http://help.github.com/mac-key-setup/ Github help page]. If you are on another system, in the Github administration, section SSH Public Keys, you should see a link to a help page. Is it done? Good, it was some difficult.
4. Now the technical part, you will need to setup your SSH public key, so you can push to your github repository from your local repository. On mac you get go on this [http://help.github.com/mac-key-setup/ Github help page]. If you are on another system, in the Github administration, section SSH Public Keys, you should see a link to a help page. Is it done? Good, it was some difficult.


5. Create a clone from your github repository<code>
5. Create a clone from your github repository
  git clone git@github.com:YOUR_GITHUB_USERNAME/moodle.git ./YOUR_LOCAL_MOODLE_FOLDER/
<code bash>
  </code>
git clone git@github.com:YOUR_GITHUB_USERNAME/moodle.git ./YOUR_LOCAL_MOODLE_FOLDER/
</code>


6. Now you are going to create update script in order to update your cvshead. For that first we need to edit the file .git/config that is in YOUR_LOCAL_MOODLE_FOLDER. Create something like this:
6. Now you are going to create update script in order to update your cvshead. For that first we need to edit the file .git/config that is in YOUR_LOCAL_MOODLE_FOLDER. Create something like this:

Revision as of 03:52, 14 December 2010

This document are for purpose to make you start super quickly (in the hour) with GIT. It doesn't have for purpose to explain you GIT. Please have a look to the real

1. Go on Github and create a account.

2. Go on https://github.com/moodle/moodle and click on Fork button. You know have you first github repository.

3. Install GIT on your computer. If you are on Mac, git-osx-installer install it in few click.

4. Now the technical part, you will need to setup your SSH public key, so you can push to your github repository from your local repository. On mac you get go on this Github help page. If you are on another system, in the Github administration, section SSH Public Keys, you should see a link to a help page. Is it done? Good, it was some difficult.

5. Create a clone from your github repository git clone git@github.com:YOUR_GITHUB_USERNAME/moodle.git ./YOUR_LOCAL_MOODLE_FOLDER/

6. Now you are going to create update script in order to update your cvshead. For that first we need to edit the file .git/config that is in YOUR_LOCAL_MOODLE_FOLDER. Create something like this:

[core]

       repositoryformatversion = 0
       filemode = true
       bare = false
       logallrefupdates = true
       ignorecase = true

[remote "origin"]

       fetch = +refs/heads/*:refs/remotes/origin/*
       url = git@github.com:YOUR_GITHUB_USERNAME/moodle.git

[branch "cvshead"]

       remote = upstream
       merge = refs/heads/cvshead

[remote "upstream"]

   url = git://git.moodle.org/moodle.git
   fetch = +refs/heads/*:refs/remotes/upstream/*

7. Create a update script (example: ./update_github)

cd YOUR_LOCAL_MOODLE_FOLDER git fetch upstream git checkout cvshead git pull git push origin refs/remotes/upstream/cvshead:cvshead

8. Run the./update_github script. Your local repository ("cvshead" branch) and your github repository ("cvshead" branch) will be updated from git.moodle.org.

9. Now when you want to work on a new issue:

a) run the update script (take care to have stach/committed the change of current branch) b) create a new branch c) fix the bug d) commit, push and do a pull request.